A locomotive train is a singly linked chain of cars given head to tail. Swap every adjacent pair of cars: the 1st and 2nd cars swap, the 3rd and 4th swap, and so on. If the number of cars is odd, the final unpaired car keeps its position. Print the resulting chain.
Input format
Line 1: an integer n, the number of cars.
Line 2: n space-separated integers, the car values from head to tail (empty line when n is 0).
Output format
Line 1: the number of cars, n.
Line 2: the values after swapping adjacent pairs, space-separated (empty line if none).
Constraints
- 0 <= n <= 100000
- -1000000000 <= each value <= 1000000000