#include <iostream>
#include <string>
using namespace std;
char bWord[100], mWord[100], eWord[100], input[20], tem[100];
string generation;
bool done;
int findDigit(const char inp[20]) {
for (int i = 0; i < 20; i++)
{
if (isdigit(inp[i])) return i;
}
return -1;
}
string runCycle(const char inp[20])
{
memset(bWord, 0, sizeof bWord);
memset(mWord, 0, sizeof mWord);
memset(eWord, 0, sizeof eWord);
int numberIndex = findDigit(inp);
if (numberIndex == -1) {
done = true;
return inp;
}
for (int i = 0; i < 20; i++) {
if (i < numberIndex)
{
bWord[i] = inp[i];
}
else if (i < (numberIndex + inp[numberIndex] - 48)) {
mWord[i - numberIndex] = inp[i + 1];
eWord[i - numberIndex] = inp[i + 1];
}
else
{
eWord[i - numberIndex] = inp[i + 1];
}
}
//cout << "Beginning word: " << bWord << endl << "Insert Word: " << mWord << endl << "Ending word: " << eWord << endl;
return string(bWord) + string(mWord) + string(eWord);
}
int main() {
cin >> input;
generation = runCycle(input);
for (int i = 0; i < 50; i++)
{
for (int j = 0; j < int(generation.length()); j++) tem[j] = generation[j];
generation = runCycle(tem);
if (done == true) {
cout << generation;
return 0;
}
}
cout << generation;
return 0;
}