IITKESO207PA6Q3 - Uncompress It!

no tags 

Nitish and Mahesh are designing an archiving tool for special Text files in English. These Text files contain only 63 types of characters: 26 characters from 'A' to 'Z', 26 characters from 'a' to 'z', 10 digits from '0' to '9' and a space character ' '.

Nitish and Mahesh came up with a slight variation of LZW compression algorithm:
initialize TABLE[0 to 63] = code for individual characters
STRING = get input symbol
while there are still input symbols:
SYMBOL = get input symbol
if STRING + SYMBOL is in TABLE:
STRING = STRING + SYMBOL
else:
output the code for STRING
if TABLE is not FULL:
add STRING + SYMBOL to TABLE
else:
output the code for CLEAR
re-initialize TABLE[0-63] = code for individual characters
STRING = SYMBOL
output the code for STRING
They decided codes for each character:
code 0 to 25 for [A-Z].
code 26 to 51 for [a-z].
code 52 to 61 for [0-9].
code 62 for ' ' (space character).
code 63 for CLEAR operation.
When you joined them and showed interest in understanding their project, they asked you to write a program for decompression. Knowing that you are new to this, Nitish simplified your task by giving you a stream of integers.

They came up with a slight variation of LZW compression algorithm:

 initialize TABLE[0 to 63] = code for individual characters
STRING = get input symbol
while there are still input symbols:
SYMBOL = get input symbol
if STRING + SYMBOL is in TABLE:
STRING = STRING + SYMBOL
else:
output the code for STRING
if TABLE is not FULL:
add STRING + SYMBOL to TABLE
else:
output the code for CLEAR
re-initialize TABLE[0-63] = code for individual characters
STRING = SYMBOL
output the code for STRING

They decided codes for each character:

code 0 to 25 for [A-Z].
code 26 to 51 for [a-z].
code 52 to 61 for [0-9].
code 62 for ' ' (space character).
code 63 for CLEAR operation. When code 63 is received, you are supposed to re-initialize TABLE.
Any new entry in the table gets the next code. So, first new entry gets 64 as code, second entry gets 65 and so on.

After you showed interest in understanding their project, Mahesh asked you to write a program for decompression. Since this is new to you, Nitish simplified your task by making you work on a stream of integers extracted from compressed file (instead of working with actual binary stream). You have to reconstruct original text.

Input

Each line will contain a code, an integer from 0 to 4095
Stop processing when you receive -1.

Output

If you encounter any error during decompression, print "Archive is corrupted!"
Else, print the uncompressed text.

Constraints

Number of lines <= 10^5
-1 <= Code on any line <= 4095
Number of characters in uncompressed text <= 2*(10^5)

Example 1

Input:
17
30
41
30
26
45
62
64
66
68
70
65
67
45
-1
Output: Repeat Repeat Repeat

Example 2

Input:
17
30
41
30
26
45
62
64
66
68
102
65
67
45
-1
Output: Archive is corrupted!


Added by:ESO207 IITK
Date:2018-04-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All