#P8706. Decode Compressed String
Decode Compressed String
Decode Compressed String
Xiaoming has a very long string composed of English letters, which may include both uppercase and lowercase characters. In this string, there may be many consecutive identical letters. To shorten the expression, he compresses consecutive identical letters into the format of letter + count. For example, a sequence of $5$ a's (i.e. $a^{5}$) can be compressed as a5
(or it could be compressed as a4a
, aa3a
, etc.).
Note that if there are more than $9$ consecutive identical letters, Xiaoming will not use the compressed format for that segment. Given a compressed string, restore the original string.
inputFormat
The input consists of one line, which is the compressed string.
outputFormat
Output the original uncompressed string.
sample
H3el5o2
HHHellllloo