712. Rotate an Array

0

Medium

Given with n element of an array and a rotation factor r , you need to rotate the array r times.

Input Format

A number representing n length of array. Second line representing the n elements of the array. Third line represents a number r as the number of rotations for the array.

Output Format

The array after r rotations in n different lines.

Example

Input

7 1 2 3 4 5 6 7 3

Output

5 6 7 1 2 3 4

Constraints

n is less than 20000
every element in the array is in integer range
r is less than 100000
Loading...

View Submissions

Console