A freight train's containers form a singly linked list, front to back. Rotate the container order to the RIGHT by k positions: the last k containers move to the front (preserving their relative order), and the remaining containers follow after them (also preserving their relative order). k may be larger than the number of containers n; only the effective rotation (k mod n) matters. Print the resulting order.
Input format
Line 1: an integer n — the number of containers.
Line 2: n space-separated integers — the container weights, front to back.
Line 3: an integer k — the rotation amount.
Output format
n space-separated integers: the weights after rotating right by k (mod n) positions.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ k ≤ 1000000000
- -1000000000 ≤ weight ≤ 1000000000