1. 
/**
* FWP: Ausgewaehlte Probleme aus dem ACM (SS10)
*
* Method: ad hoc
* Problem: 445 - Marvelous Mazes
* Accepted: 0.100
* @author Evgeni Pavlidis
*
*/import java.io.*;
import java.util.*;

public class Main {

public static void main(String...args) throws Exception
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String input;
StringBuffer output = new StringBuffer();
char c;

int sum = 0;

while( (input = reader.readLine()) != null)
{
input = input.replace('b', ' ');

for(int i = 0; i < input.length(); i++)
{
c = input.charAt(i);
if(Character.isDigit(c))
sum += c - '0';
else if(c == '!')
output.append("\n");
else
for(; sum > 0; sum--)
output.append(c);

}
output.append("\n");
}

System.out.print(output);
}
}