Skip to content
UPEEC

Rotate Right by K

Easy#arrays· solved by 0 · time limit 2.0 s

Rotate the array to the right by kk steps: the last kk elements move to the front.

Input

nn, then nn integers, then kk.

Output

The rotated array.

Constraints

1≤n≤1051 \le n \le 10^5, 0≤k≤1090 \le k \le 10^9

Sample 1

Input

5
1 2 3 4 5
2

Output

4 5 1 2 3

Sign in or join free to run and submit your solution.