#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
int main(){
string s;
while(getline(cin,s)){
if(s.empty()){
cout << endl;
}
string result = "";
int sum = 0;
for(int i = 0; i < s.length(); i++){
bool isDigit = s[i] >= '0' && s[i] <= '9';
if(isDigit){
sum += s[i] - '0';
} else {
char add = s[i];
if(s[i] == 'b'){
add = ' ';
} else if(s[i] == '!'){
result += '\n';
}
for(int u = 0; u < sum; u++){
result += add;
}
sum = 0;
}
}
cout << result;
if(!cin.eof() && !s.empty()){
cout << endl;
}
}
return 0;
}