#K52437. Taco - Character Count String

    ID: 29309 Type: Default 1000ms 256MiB

Taco - Character Count String

Taco - Character Count String

Given a string s, construct a new string by appending to each character the number of times it has appeared so far in s. For example, if s = "hello" then the resulting string should be "h1e1l1l2o1".

Formally, for each character \( c = s[i] \) at index \( i \) (with \( i \) starting from zero), let \( count(c, i) \) denote the number of occurrences of \( c \) in the substring \( s[0 \ldots i]\). The output string is the concatenation of each character and its corresponding count:

\[ result = s[0] + count(s[0], 0) + s[1] + count(s[1], 1) + \cdots + s[n-1] + count(s[n-1], n-1) \]

If the string is empty, output an empty string.

inputFormat

The input consists of a single line containing the string s. The string may include letters, digits, and special characters.

outputFormat

Output a single line containing the newly constructed string as described above.

## sample
hello
h1e1l1l2o1