#include <stdio.h>
#include <string.h>
int is_mynumber(char a) {
int is_number = 0;
if (a >= '2' && a <= '9') {
is_number = 1;
}
return is_number;
}
void result(char a[]) {
int i = 0;
while (a[i] != '\0') {
if (a[i + 1] != '\0') {
i++;
int is_number = is_mynumber(a[i]);
if (is_number) {
int times = a[i] - '0';
while (times > 0) {
printf("%c", a[i - 1]);
times--;
}
}
if (!is_number) {
printf("%c", a[i - 1]);
}
i++;
} else if (a[i + 1] == '\0') {
printf("%c", a[i]);
i++;
}
}
}
int main() {
char a[1001];
scanf("%[^\n]", a);
result(a);
return 0;
}