Football
At the World Cup, a new method for greeting teams has been introduced. Teams line up in a row with their captains standing next to each other, and the rest of the team members positioned on either side of their respective captains. The captains step forward, greet each other, and then move to the opposite ends of their teams. Occasionally, a referee may stand between the captains, but this does not alter the greeting process. Your task is to write a program that outputs the arrangement of people on the field after the captains have greeted each other.
Input
Each person on the field is identified by a number on their jersey. For simplicity, assume the referee also wears a jersey with a number. First, you are given the number of people n (1 ≤ n ≤ 200) present on the field. Following this, n numbers are provided, representing the jersey numbers of the individuals (jersey numbers are natural numbers ≤ 1000).
Output
Output n numbers, which are the jersey numbers of the people on the field after the captains have completed their greeting.
Notes
In the first example, the referee has the jersey number 7. The captains standing next to the referee have jersey numbers 56 and 12. After shaking hands, one captain moves to the start of the row, and the other to the end.
In the second example, there is no referee. The captains have jersey numbers 5 and 6. After greeting, they also move to opposite ends of the row.