eolymp
bolt
Try our new interface for solving problems
Problems

Ministry of Truth

Ministry of Truth

Winston John works in the Ministry of Truth. Recently he was promoted to the head of the department, which deals with the journal "Informatics and Life". In connection with the changed political situation, all issues of the journal should be urgently brought into line with the current reality.

In subordinate, John has three employees of the ministry, between whom he is going to divide all the work. In order to avoid confusion, John wants to assign a first issues of the magazine to the first, b to the second and c to the last third employee. At the same time, each employee must get at least one issue. Since similar works are being conducted not for the first time, for every issue of the magazine it is known how many minutes it takes to bring its content into line with the political situation.

The task will be executed when each employee finishes making changes. If the employee copes with his part before the rest, then the remaining time he can use at his discretion. Let the minimum and maximum time spent by employees to perform their work is Tmin and Tmax respectively. The task will be executed in the time Tmax, and the maximum amount of free time that his subordinates will have is Tmax - Tmin.

John believes that a large amount of free time is bad for the morale of subordinates. Help John to distribute the work so that the value of Tmax - Tmin will be minimal.

Input

First line contains one integer n (3n100000) - number of journal issues. Second line contains n integers t1, t2, ..., tn (0t1, t2, ..., tn109) - the number of minutes that a Truth Ministry employee will need to make a change to the corresponding issue of the journal.

Output

Print space separated the numbers a, b and c (a + b + c = n, a, b, c > 0) - the number of issues of the journal, that should be assigned to first, second and third employees. If there are several answers, output any.

Time limit 1 second
Memory limit 128 MiB
Input example #1
6
1 2 3 0 2 1
Output example #1
2 1 3
Input example #2
3
1 2 3
Output example #2
1 1 1
Source 2011 Цикл Интернет-олимпиад для школьников, Восьмая индивидуальная олимпиада, March 27, Problem B