Олимпиадный тренинг

Задача 23406. Unpacking a line


We will consider only lines consisting of capital Latin letters. For example, consider the string AAAABCCCCCDDDD. The length of this string is 14. Since the string consists of only Latin letters, the repeated characters can be removed and replaced by numbers specifying the number of repetitions. Thus, this string can be represented as 4AB5C4D.  The length of such a string is 7. We will call the described method packing a string. 
 
Write a program that takes a packed string and restores the original string from it.
 
Output data
The input file contains one packed line. A string can only contain constructions of the form nA, where n is the number of repetitions of a character (an integer from 2 to 99), and A is a capital Latin letter, or constructions of the form A, that is, a character without a number that defines  ;number of repetitions. The maximum length of a string does not exceed 80.
 
Output
Output the restored string to the output file. In this case, the string must be broken into lines of exactly 40 characters (except for the last one, which may contain less than 40 characters).
 
Examples
 
Input Output
3A4B7D                      AAABBBBDDDDDDD
22D7AC18FGD
DDDDDDDDDDDDDDDDDDDDDDAAAAAAACFFFFFFFFFF
FFFFFFFFGD
95AB
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAB
40AB39A
 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA