Skip to lesson

A easy problem for practising 5.4 Array & String Techniques. Solve it in your own IDE, check it against every test, and open a hint only when you are stuck. 0/1 solved.

1. Compress the attendance code

easy

A school stores attendance as a string of capital letters, such as PPPAAP (P for present, A for absent, L for late). To save space, each run of the same letter is written as the letter followed by the length of the run.

For example, PPPAAP becomes P3A2P1. Print the compressed form of the given string.

Input: One line with the string s.

Output: One line: the compressed string.

Limits: 1 ≤ length of s ≤ 10^5 · s has only capital letters A–Z

Example 1

Input

PPPAAP

Output

P3A2P1

Three P, two A, then one P.

Example 2

Input

A

Output

A1

A single letter still gets its count.

Submit to solve