Problem Statement:
Multimedia Systems is a fundamental course for computer science students. In this course students learn various methods of data encoding and compression (e.g. image compression) in order to exploit the redundancy that exists in natural pictures or other data and achieve a bandwidth reduction, thus data can be sent through a communication channel in a reasonable time.

One of the most popular methods of lossless data compression is known as RLE (Run Length Encoding). In this scheme we aim to reduce the number of symbols to be sent by only sending the first occurrence of a symbol in a continuous sequence of the same symbol, followed by a number (without leading zeros) which represents the count of its occurrences (it is also called a run length).

In this problem we will only deal with text data, because pictures encoding will be studied well later on at university.

Suppose you have the string of upper case English letters "ABBBCCCCEEDFFFFFFF" it will be encoded by RLE to become like "A1B3C4E2D1F7" (you can notice the amount of reduction between the two strings).


Input Format:
The first line of the input will contain an integer T, the number of test cases. T lines follow, each line contains a non-empty string which consists of at most 2000 upper case English letters.


Output Format:
For each test case, print the RLE encoded string as described above.


Sample Input:
2 ABBBCCCCEEDFFFFFFF ACMSCPC


Sample Output:
A1B3C4E2D1F7 A1C1M1S1C1P1C1





Added by: alaa.jrad
Added at: 2014-07-26 09:00:04 UTC
Time Limit: 2 seconds
Partial score: No
Source:Tishreen University First Training Contest 2014