A Ternary Problem

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

You are given a ternary string of length \(N\) containing only \(0\)s, \(1\)s, and \(2\)s. You must print the occurrence of each digit.

Input Specification

The first line will contain the integer \(N\ (1 \le N \le 10^6)\).

The second line will contain the ternary string containing only \(0\)s, \(1\)s and \(2\)s.

Output Specification

On the first line, print \(3\) integers. The first integer is the number of \(0\)s, the second is the number of \(1\)s, and the third is the number of \(2\)s.

Sample Input


Sample Output

2 1 2


There are no comments at the moment.