Leaderboard
Showing:
Easy string
Easy Accuracy: 33.38% Submissions: 6833 Points: 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

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Easy string

Output Window