output_description: Print the (X/2)-th (rounded up to the nearest integer) lexicographically
  smallest sequence listed in FEIS, with spaces in between, where X is the total
  number of sequences listed in FEIS.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K N
attempt: from math import ceil
  
  k, n = [int(x) for x in input().strip().split()]
  li = [pow(k, i) for i in range(1, n + 1)]
  for i in range(1, n):
      li[i] += li[i - 1]
  li.reverse()
  li.append(0)
  li.append(-1)
  target = ceil(li[0] / 2)
  results = []
  
  
  # print(li)
  def f(i, target):
      if target == 0:
          return
      if li[i] == -1:
          return
      div = (target - 1) // (li[i] + 1)
      results.append(div + 1)
      # print(i, target, results)
      f(i + 1, (target - 1) % (li[i] + 1))
  
  
  f(1, target)
  print(" ".join(map(str, results)))
  
problem_description: Statement
  
  In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of
  lengths between 1 and N (inclusive) consisting of integers between 1 and K
  (inclusive) are listed.
  
  Let the total number of sequences listed in FEIS be X. Among those sequences,
  find the (X/2)-th (rounded up to the nearest integer) lexicographically
  smallest one.
samples: [{"input": "3 2", "output": "2 1 \n    \n\nThere are 12 sequences listed in FEIS:\n(1),(1,1),(1,2),(1,3),(2),(2,1),(2,2),(2,3),(3),(3,1),(3,2),(3,3). The (12/2 =\n6)-th lexicographically smallest one among them is (2,1).\n\n* * *"}, {"input": "2 4", "output": "1 2 2 2\n    \n\n* * *"}, {"input": "5 14", "output": "3 3 3 3 3 3 3 3 3 3 3 3 2 2"}]