Richard is a penguin running a lockout tournament for students who are vying to qualify for CCO.
The students are seeded from to , and every pair of students will face off in a match where either the match ends in a tie or one student wins, and the other loses.
In the event of a tie, both students earn points. Otherwise, the winner earns points, and the loser earns points.
Students are then ranked in decreasing order by their number of points. Students who are tied by points are ranked in increasing order by seed.
For given values of , , , , and , compute the maximum and minimum number of points that the student ranked th can have.
Constraints
In tests worth 3 marks, and .
In tests worth an additional 3 marks, .
In tests worth an additional 3 marks, .
Input Specification
The first line contains a single integer, .
The next lines contain five integers, , , , , and .
Output Specification
Output lines. On the th line, output two integers, the maximum and minimum number of points the th ranked student can have.
Sample Input
1
4 1 3 1 0
Sample Output
9 3
Comments