output_description: If it is impossible to partition the integers satisfying the condition, print
  `-1`. If it is possible, print N triples in the following format:
  
      
      
      a_1 b_1 c_1
      :
      a_N b_N c_N
      
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
attempt: # -*- coding: utf-8 -*-
  
  
  def solve():
      N, K = map(int, input().split())
      if K > (N + 1) / 2:
          return "-1"
  
      L = [[K, K + N, K + 2 * N] for i in range(N)]
      for i in range(N):
          if N % 2:
              j = (N - 1 - 2 * i) % N
              k = (2 * i) % N
          else:
              j = (N - 1 - 2 * i) % N - i // (N // 2)
              k = (1 + 2 * i) % N - i // (N // 2)
          L[i][0] += i
          L[j][1] += i
          L[k][2] += i
      res = "\n".join(" ".join(map(str, l)) for l in L)
      return res
  
  
  if __name__ == "__main__":
      print(solve())
  
problem_description: Statement
  
  Given are positive integers N and K.
  
  Determine if the 3N integers K, K+1, ..., K+3N-1 can be partitioned into N
  triples (a_1,b_1,c_1), ..., (a_N,b_N,c_N) so that the condition below is
  satisfied. Any of the integers K, K+1, ..., K+3N-1 must appear in exactly one
  of those triples.
  
    * For every integer i from 1 to N, a_i + b_i \leq c_i holds.
  
  If the answer is yes, construct one such partition.
samples: [{"input": "1 1", "output": "1 2 3\n    \n\n* * *"}, {"input": "3 3", "output": "-1"}]