영어 원문입니다. 원문의 수식·표를 글자로 옮겨 모양이 다를 수 있습니다. 정확한 내용은 원문 페이지에서 확인하세요. 원문 페이지 열기 (새 창)
Problem
During a PE class, the teacher wants to divide all students into two teams to compete in a tug of war. To make the tug of war interesting, the teams should be exactly the same size, as well as exactly equally strong. The teacher has estimated the strength of each student in advance as an integer between 1 and 4. The strength of a team is the sum of the strengths of its members.
Given how many students of each strength are attending the class, can you tell the teacher how to divide the teams? It is guaranteed that the strengths of the students are such that this is always possible.
Input
The first and only line contains the four integers s_1, s_2, s_3, s_4 (0 ≤ s_i ≤ 10^7), where s_i is the number of students with strength i.
Output
Print a line with four integers a_1, a_2, a_3, a_4, where a_i is the number of students with strength i that should be on one of the teams. If there are multiple solutions, you may print any of them.
Scoring
Your solution will be tested on a set of test groups. To earn points for a group, you must pass all test cases in that group.
| Group | Points | Constraints |
|---|---|---|
| 1 | 20 | s_i ≤ 300 |
| 2 | 20 | s_i ≤ 2000 |
| 3 | 20 | No student has strength 4. |
| 4 | 40 | No additional constraints. |
Explanation of Samples
In the first sample, there are four students, one of each strength. Each team should thus have two students. If the students with strengths 1 and 4 are chosen for one team and the students with strengths 2 and 3 are chosen for the other, both teams get the same strength, namely 5.
예제
예제 1
1 1 1 1
0 1 1 0
예제 2
2 4 6 8
0 3 4 3