//#include <stdio.h>
#include <iostream>
#include <sstream>
#include <cstring>
#include <math.h>
int wut(char * asd) {
if (asd == 0) { return 0; }
int i = 0;
while (1) {
if (asd[i] != '\0') {
i++;
}
else {
break;
}
}
return i;
}
void append(char ** dst, char * thing) {
int a = wut(*dst);
int b = wut(thing);
char * lol = new char[a+b+1];
lol[a + b] = '\0';
memcpy(lol, *dst, a);
memcpy(lol + a, thing, b);
delete[] * dst;
*dst = lol;
}
int shittyAtoi(char * input, int numNumbers) {
int num = 0;
for (int i = 0; i < numNumbers; i++) {
if (i == numNumbers - 1) {
num = num + (input[i] - 48);
}
else {
num = num + (input[i] - 48) * pow(10,(numNumbers-i-1));
}
}
return num;
}
char * notmain(char * input) {
char * masterbuf = nullptr;
int offset = 0;
int tröiger = 0;
char nums[20];
int nn = 0;
char letts[10000];
int nl = 0;
while (1) {
char c = input[offset];
if ((c <= 57 && c >= 48) || c == '\0') {
if (tröiger == 1) {
nums[nn] = '\0';
letts[nl] = '\0';
int num = shittyAtoi(nums, nn);
for (int i = 0; i < num; i++) {
append(&masterbuf, letts);
}
if (c == '\0') {
break;
}
tröiger = 0;
nums[0] = c;
nn = 1;
nl = 0;
}
else {
nums[nn] = c;
nn++;
}
}
else {
letts[nl] = c;
nl++;
tröiger = 1;
}
offset++;
}
return masterbuf;
}
int main() {
std::string input;
std::cin >> input;
std::cin.get();
char * res = notmain((char *)(input.c_str()));
std::cout << res;
std::cin.get();
return 0;
}