To make the 2028 Summer Olympics even more exciting, the organizers have planned an XXL football match for both the opening and closing ceremonies. A special meter field is already in construction for these games!
here are athletes participating, coming from countries. Specifically, athletes are representing country for each from to , inclusive. For the two football games we have the following restrictions:
- For the opening ceremony, two teams of athletes each must be formed.
- For the closing ceremony, two teams of athletes each must be formed.
- Every athlete must participate in exactly one game (either opening or closing), and in only one team.
- No two athletes from the same country may play against each other in a game.
As the chief computer scientist of the Olympics, your task is to divide the athletes into four teams (two per game) satisfying all the above conditions.
You can assume that:
- , that is, the opening is at least as popular as the closing ceremony.
- , that is, the opening may be just slightly more popular than the closing ceremony.
- No country sends more than athletes.
We can prove that a valid assignment always exists under the given conditions.
Input data
The first line contains two integers and - the numbers of countries, and the number of athletes to play in a team in the opening ceremony, respectively.
The second line contains positive integers , the number of athletes from each country.
Output data
Print lines. Line should contain the assignment of the athletes from country , represented by four non-negative integers:
- The number of athletes assigned to the home team of the opening ceremony.
- The number of athletes assigned to the away team of the opening ceremony.
- The number of athletes assigned to the home team of the closing ceremony.
- The number of athletes assigned to the away team of the closing ceremony.
If there are multiple valid solutions, you may output any of them.
Constraints and clarifications
- .
- is even. Let .
- for each .
- .
# | Score | Restrictions |
---|---|---|
0 | 0 | Examples |
1 | 10 | . |
2 | 10 | . |
3 | 20 | is even and . |
4 | 20 | is divisible by and . |
5 | 40 | No additional limitations. |
Example 1
stdin
3 4
5 3 6
stdout
4 0 1 0
0 0 0 3
0 4 2 0
Explanation
In the first sample case one valid assignment is:
- athletes from country play against athletes from country in the opening ceremony.
- All athletes from country play against the remaining athletes from countries and in the closing ceremony.
Note that there exist other valid assignments.
Example 2
stdin
5 6
3 4 3 6 4
stdout
2 0 0 1
0 4 0 0
0 2 0 1
4 0 0 2
0 0 4 0