~~~
def reverse(a,size):
b = []
for i in range(size - 1,-1,-1):
b.append(a[i])
for i in range(size,len(a)):
b.append(a[i])
for i in b:
print(i,end = ‘ ‘)
n,size = map(int,input().split())
a = list(map(int,input().split()))
reverse(a,size)