#include <bits/stdc++.h>
using namespace std ;
int main() {
string s;
while(cin>>s)
{
int sum=0;
for(int i=0; i<s.size(); i++)
{
if(s[i]>=48&&s[i]<=57) sum+=s[i]-48;
else if (s[i]=='!') cout<<'\n';
else if (s[i]=='b') {cout<<string(sum,' '); sum=0;}
else {cout<<string(sum,s[i]); sum=0;}
}
cout<<endl;
}
}