2000 LSU Computer Science High School Programming Contest
Novice Problem 2: String Compression

MAIN
  Home
  Schedule
  Rules
  Compile

RESULTS
  Results

PROBLEMS
  Novice
  Veteran
  All

  

Consider the string AAAABCCCCCDDDD consisting of alphabetic characters only. This string is of length 14. Since the string consists of alphabetic characters only, duplicate characters can be removed and replaced with a duplication factor n. With this technique the string can be compressed and represented by 4AB5C4D. The compressed string is of length 7. Write a program which takes a string in compressed form and recreates the original uncompressed string.

Input

Input will be a series of lines with one string per line. There will be only uppercase letters and digits in the string. All digits are compression counts. There will never be two digits in a row. You stop reading lines when you read a line with only a # on it. No input line will be longer than 50 characters.

Output

You are to output one line for each line of input. The output should be the uncompressed version of the input line.

Sample Input

3A4B7D
2D7AC8FGD
2ABCDE
#

Sample Output

AAABBBBDDDDDDD
DDAAAAAAACFFFFFFFFGD
AABCDE



The statements and opinions included in these pages are those of the LSU Computer Science High School Programming Contest Staff only. Any statements and opinions included in these pages are not those of Louisiana State University or the LSU Board of Supervisors.

© 2000 LSU Computer Science High School Programming Contest

This page last updated 2001/04/05 20:28:51.