output_description: Print the lexicographically smallest permutation that can be obtained.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N K
      P_1 P_2 ... P_N
attempt: n, k = map(int, input().split())
  nums = list(map(int, input().split()))
  dict_indexs = {}
  for i, num in enumerate(nums):
      dict_indexs[num - 1] = i
  while True:
      flag = False
      for i in range(n - 1):
          a = dict_indexs[i]
          b = dict_indexs[i + 1]
          if a - b >= k:
              dict_indexs[i] = b
              dict_indexs[i + 1] = a
              flag = True
      if flag:
          continue
      else:
          break
  for i in range(n):
      print(dict_indexs[i] + 1)
  
problem_description: Statement
  
  You are given a permutation P_1 ... P_N of the set {1, 2, ..., N}.
  
  You can apply the following operation to this permutation, any number of times
  (possibly zero):
  
    * Choose two indices i,j (1 ≦ i < j ≦ N), such that j - i ≧ K and |P_i - P_j| = 1. Then, swap the values of P_i and P_j.
  
  Among all permutations that can be obtained by applying this operation to the
  given permutation, find the lexicographically smallest one.
samples: [{"input": "4 2\n    4 2 3 1", "output": "2\n    1\n    4\n    3\n    \n\nOne possible way to obtain the lexicographically smallest permutation is shown\nbelow:\n\n  * 4 2 3 1\n  * 4 1 3 2\n  * 3 1 4 2\n  * 2 1 4 3\n\n* * *"}, {"input": "5 1\n    5 4 3 2 1", "output": "1\n    2\n    3\n    4\n    5\n    \n\n* * *"}, {"input": "8 3\n    4 5 7 8 3 1 2 6", "output": "1\n    2\n    6\n    7\n    5\n    3\n    4\n    8"}]