#abc368a. A - Cut

A - Cut

Score : 100100 points

问题陈述

有一堆 NN 张卡片,从顶部数第 ii 张卡片上写着一个整数 AiA_i

你从这堆卡片的底部取出 KK 张卡片,并将它们放在顶部,保持它们的顺序。

打印操作后从顶部到底部卡片上写的整数。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

There is a stack of NN cards, and the ii-th card from the top has an integer AiA_i written on it.

You take KK cards from the bottom of the stack and place them on top of the stack, maintaining their order.

Print the integers written on the cards from top to bottom after the operation.

Constraints

  • 1K<N1001 \leq K < N \leq 100
  • 1Ai1001 \leq A_i \leq 100
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN KK

A1A_1 A2A_2 \ldots ANA_N

Output

Let BiB_i be the integer written on the ii-th card from the top of the stack after the operation. Print B1,B2,,BNB_1,B_2,\ldots,B_N in this order, separated by spaces.

Sample Input 1

5 3
1 2 3 4 5

Sample Output 1

3 4 5 1 2

Initially, the integers written on the cards are 1,2,3,4,51,2,3,4,5 from top to bottom.

After taking three cards from the bottom of the stack and placing them on top, the integers written on the cards become 3,4,5,1,23,4,5,1,2 from top to bottom.

Sample Input 2

6 2
1 2 1 2 1 2

Sample Output 2

1 2 1 2 1 2

The integers written on the cards are not necessarily distinct.

}