#CCBCHBAHAI0000032. Dịch vòng trái (Left Rotation)

Dịch vòng trái (Left Rotation)

Dịch vòng trái (Left Rotation)

Source: HackerRank

Version: Phuoc Hung OJ Extended

Problem

Given an integer array a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1} and a non-negative integer dd.

One left rotation by one position transforms

(a0,a1,…,an−1)(a_0,a_1,\ldots,a_{n-1})

into

(a1,a2,…,an−1,a0).(a_1,a_2,\ldots,a_{n-1},a_0).

Perform dd left rotations. Define

s=d mod n.s=d\bmod n.

Then the result bb satisfies

bi=a(i+s) mod n,0≤i<n.b_i=a_{(i+s)\bmod n},\qquad 0\le i<n.

Print bb.

Input

The first line contains integers nn and dd. The second line contains nn integers a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1}.

Output

Print the array after dd left rotations on one line.

Subtask

Subtask 1 (100 points): 1≤n≤2⋅1051\le n\le 2\cdot10^5; 0≤d≤10180\le d\le10^{18}; ∣ai∣≤109|a_i|\le10^9.

Example

Input

5 4
1 2 3 4 5

Output

5 1 2 3 4

Explanation

Here s=4 mod 5=4s=4\bmod5=4. Thus b0=a4=5b_0=a_4=5, followed by a0,a1,a2,a3a_0,a_1,a_2,a_3.