| XXX Spain Olympiad in Informatics, Day 1 |
|---|
| Закончено |
Morse code is a system for representing characters using short and long signals, traditionally called dots (.) and dashes (-). It was developed in the 19th century for use in the telegraph and made it possible to transmit information over long distances using sequences of pulses.
In the standard version of Morse code, each decimal digit from 0 to 9 is represented by a combination of exactly five symbols, according to the following table:
| Digit | Morse code | Digit | Morse code | |
| 0 | ----- | 5 | ..... | |
| 1 | .---- | 6 | -.... | |
| 2 | ..--- | 7 | --... | |
| 3 | ...-- | 8 | ---.. | |
| 4 | ....- | 9 | ----. |
To encode a sequence of digits, the representations corresponding to each of them are concatenated without adding any additional separators.
Given a sequence of digits, we want to determine how many dots and how many dashes appear in total in its Morse code encoding.
The input begins with an integer $$$T$$$, which indicates the number of test cases.
Each of the following $$$T$$$ cases consists of a line containing a non-empty sequence of decimal digits (0–9).
For each test case, you must print a line with two integers separated by a space: the total number of dots followed by the total number of dashes.
3510314159
5 01 915 15
$$$1 \le T \le 1000$$$
The length of the sequence ranges between $$$1$$$ and $$$1000$$$.
| Название |
|---|


