A warehouse cart chain is modeled as a singly linked list of parcel weights, front to back. Swap the weights carried by every adjacent pair of carts: the 1st and 2nd carts swap weights, the 3rd and 4th swap weights, and so on. If the chain holds an odd number of carts, the last (unpaired) cart keeps its original weight. Print the resulting weights, front to back.
Input format
Line 1: an integer n — the number of carts.
Line 2: n space-separated integers — the weights, front to back.
Output format
n space-separated integers — the weights after swapping adjacent pairs.
Constraints
- 1 ≤ n ≤ 100000
- -1000000000 ≤ weight ≤ 1000000000