#C4302. Count Digits and Letters

    ID: 47826 Type: Default 1000ms 256MiB

Count Digits and Letters

Count Digits and Letters

You are given T test cases. Each test case consists of a string. For each string, count the number of digits (0-9) and the number of letters (both uppercase and lowercase A-Z).

Formally, for a string \( s \), let \( D = \sum_{i=1}^{|s|} [s_i \text{ is a digit}] \) and \( L = \sum_{i=1}^{|s|} [s_i \text{ is a letter}] \). Output two integers \( D \) and \( L \) separated by a space for each test case on a new line.

inputFormat

The input begins with an integer T (the number of test cases) on the first line. It is followed by T lines, each containing a string that represents a test case.

outputFormat

For each test case, output a single line with two space-separated integers: the count of digits and the count of letters in the given string.

## sample
1
123456
6 0

</p>