Unpacking a line
We will focus on strings composed solely of uppercase Latin letters. For instance, take the string AAAABCCCCCDDDD. This string has a length of 14. Since it consists only of Latin letters, we can compress it by replacing consecutive repeating characters with a number indicating their count. Thus, the string can be compressed to 4AB5C4D, which has a length of 7. This method of representing a string is called compression.
Your task is to write a program that takes a compressed string and reconstructs the original string from it.
Input
The input consists of one compressed string. This string may include patterns of the form nA, where n is an integer from 2 to 99 representing the number of repetitions, and A is an uppercase Latin letter. It may also include patterns of the form A, which is a single character without a preceding number. The maximum length of the compressed string is 80.
Output
The output should be the reconstructed string, divided into lines of exactly 40 characters each, except for the last line, which may contain fewer than 40 characters.