Problem C
Eb Alto Saxophone Player

My fingers move a lot when playing
some music, and I’m quite interested in how many times each
finger presses a button. Assume that
the music is composed of only
-
c: finger
- , - -
d: finger
- , - -
e: finger
- , , -
f: finger
- , -
g: finger
- -
a: finger
, -
b: finger
-
C: finger
-
D: finger
- , - -
E: finger
- , , -
F: finger
- , -
G: finger
- -
A: finger
- -
B: finger
-
(Note that every finger is controlling a specific button, different fingers are controlling different buttons.)
Write a program to help count the number of times each finger presses the button. A finger presses a button if it is needed in a note, but not used in the last note. Also, if it is the first note, every finger required presses a button.
Input
The first line of the input is a single integer
Output
For each test case, print
Sample Input 1 | Sample Output 1 |
---|---|
3 cdefgab BAGFEDC CbCaDCbCbCCbCbabCCbCbabae |
0 1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 0 1 8 10 2 0 0 2 2 1 0 |