#include <iostream>
using namespace std;
int main(){
string s;
cin >> s;
char now;
int i = 0;
while(i < s.size()){
now = s[i];
if(i + 1 < s.size() && s[i + 1] <= '9' && s[i + 1] >= '0'){
int amount = s[i + 1] - '0';
for(int j = 0; j < amount; j ++ ) cout << now;
i += 2;
}else{
cout << now;
i ++ ;
}
}
return 0;
}