Easy string
Submissions: 3375   Accuracy:

36.46%

  Difficulty: Easy   Marks: 2

Compress the string when lower and upper case are same. In compressed string characters should be in lowercase.

for ex:     input    aaABBb

               output  3a3b

Input

  • The first line of the input contains a single integer T denoting the number of test cases.
  • The first line of each test case contains string s.

Output

For each test case, output the required string.

Constraints

    •    1 ≤ T ≤ 101

    •    1 ≤ |s|≤ 1000

Example

Input:

3

aabbB

abc

aaacca

Output:

2a3b

1a1b1c

3a2c1a

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: CHANDRAKANT
Author: TheRed_Viper


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.