This page is still under construction.

Parts of this page are still being built. What you see may change.

Keystrokes per Finger

Interview

Time limit1sMemory limit32 MB

Summary
Count how many times each of the eight fingers presses a key when the given string is typed on the fixed US layout.
Level

Easy1 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

Touch typing is worth learning. If you still type with two or three fingers, relearn it from the start. Once the habit sets in you type faster and your hands tire less.

Proper typing fixes which finger presses which key. On the US layout, the eight fingers other than the thumbs cover these keys:

Left pinky: ` 1 Q A Z
Left ring: 2 W S X
Left middle: 3 E D C
Left index: 4 5 R T F G V B
Right index: 6 7 Y U H J N M
Right middle: 8 I K ,
Right ring: 9 O L .
Right pinky: 0 - = P [ ] \ ; ' /

The left hand covers the left side of the keyboard, starting at 5, T, G, B and going left. The right hand covers the right side, starting at 6, Y, H, N and going right. The thumbs press only the space bar, so this problem ignores them. Programmers often pick the US layout because characters like [ and ] are easy to reach on it.

Count how many times each finger other than the thumbs presses a key while the given string is typed by these rules.

Input

The first and only line contains a string of length 1 to 50. It has no whitespace and uses only the 47 characters listed in the table above. Every letter is uppercase.

Output

Print eight lines, one integer per line, giving the number of presses by each finger. The order is the same as the table, from the left pinky to the right pinky, left to right.

Examples3

  1. Example 1

    Input
    AON=BOO;
    
    Expected output
    1
    0
    0
    1
    1
    0
    3
    2
    
  2. Example 2

    Input
    PRINT'NY'[NASLA]
    
    Expected output
    2
    1
    0
    2
    4
    1
    1
    5
    
  3. Example 3

    Input
    VIDI,KO,JE,DOSA
    
    Expected output
    1
    1
    3
    1
    1
    6
    2
    0