You are given N natural numbers and K swaps are allowed. Determine the largest permutation that you can attain.

INPUT:
First line contains N and k
next line has N spaced integers

OUTPUT:
Print the largest permutation array.

0<N<10^5
0<K<10^5

SAMPLE INPUT
5 1
4 2 3 5 1

SAMPLE OUTPUT
5 2 3 4 1
n,k=raw_input().split()
n,k=int(n),int(k)
l=[int(i) for i in raw_input().split()]
x=0
swap_i=0
while k:
    max_e=0
    k-=1
    for i in range(x,n):
        if(l[i] >= max_e ):
            max_e=l[i];
            swap_i=i
    l[x],l[swap_i]=l[swap_i],l[x]
    x+=1
    
    if(swap_i == x):
    	k+=1
    
for i in l:
    print i,