#39673: 自己抄


qiyalin136 (JAK)


解答

 

n=int(input())
mot=[]
while True:
    try:
        mot.append(int(input())%3)
    except :
        break
print(mot.count(0),mot.count(1),mot.count(2))