시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 2 2 2 100.000%

문제

1974년 FIFA 월드컵 공인구 텔스타는 12개의 검은 오각형과 20개의 흰 육각형 가죽 조각으로 이루어져 있다. 각각의 오각형은 육각형 다섯 개와과 접하고, 육각형은 오각형 3개와 육각형 3개와 접한다.

원섭이는 조각의 변을 따라 선을 교차하지 않게 그려서 다각형을 만들었다. 원섭이는 자신이 그린 다각형 안에 있는 가죽을 초록색으로 색칠했다.

원섭이가 그린 다각형의 정보가 주어졌을 때, 검정색, 흰색, 초록색 가죽 조각의 수를 계산하는 프로그램을 작성하시오.

입력

첫째 줄에는 다각형 꼭지점의 개수 n이 주어진다. 둘째 줄에는 n개의 정수 a1, a2, ..., an이 공백으로 구분되어 주어진다. ai(1 또는 2)는 다각형의 i번째 꼭지점과 인접한 초록 가죽의 개수이다. 첫번째 꼭지점과 n번째 꼭지점을 잇는 변 항상 두 육각형 위에 있다.

출력

첫째 줄에 검정 가죽의 개수, 흰 가죽의 개수, 초록 가죽의 개수를 공백으로 구분해 출력한다.

예제 입력 1

21
1 2 1 2 1 2 1 1 1 2 2 1 1 1 1 2 2 2 1 1 1

예제 출력 1

11 15 6
W3sicHJvYmxlbV9pZCI6IjM0NTYiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWNkOTVcdWFkNmNcdWFjZjUiLCJkZXNjcmlwdGlvbiI6IjxwPlxyXG5cdDE5NzRcdWIxNDQgRklGQSBcdWM2ZDRcdWI0ZGNcdWNlZjUgXHVhY2Y1XHVjNzc4XHVhZDZjIFx1ZDE1NFx1YzJhNFx1ZDBjMFx1YjI5NCAxMlx1YWMxY1x1Yzc1OCBcdWFjODBcdWM3NDAgXHVjNjI0XHVhYzAxXHVkNjE1XHVhY2ZjIDIwXHVhYzFjXHVjNzU4IFx1ZDc3MCBcdWM3MjFcdWFjMDFcdWQ2MTUgXHVhYzAwXHVjOGZkIFx1Yzg3MFx1YWMwMVx1YzczY1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