#include<bits/stdc++.h>
using namespace std;
const int N = 1000;
char b[N];
int main()
{
scanf("%s",b);
for(int i = 0;b[i] != '\0' ;++i)
{
if(b[i] >= 'A')
{
if(b[i+1] <= '9' && b[i + 1] >= '0')
{
for(int j = 0;j < b[i + 1] - '0';++j) putchar(b[i]);
}
else
{
putchar(b[i]);
}
}
}
return 0;
}