atcoder#NIKKEI20192QUALE. Non-triangular Triplets

Non-triangular Triplets

Score : 700700 points

Problem Statement

Given are positive integers NN and KK.

Determine if the 3N3N integers K,K+1,...,K+3N1K, K+1, ..., K+3N-1 can be partitioned into NN triples (a1,b1,c1),...,(aN,bN,cN)(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+3N1K, K+1, ..., K+3N-1 must appear in exactly one of those triples.

  • For every integer ii from 11 to NN, ai+bicia_i + b_i \leq c_i holds.

If the answer is yes, construct one such partition.

Constraints

  • 1N1051 \leq N \leq 10^5
  • 1K1091 \leq K \leq 10^9

Input

Input is given from Standard Input in the following format:

NN KK

Output

If it is impossible to partition the integers satisfying the condition, print -1. If it is possible, print NN triples in the following format:

a1a_1 b1b_1 c1c_1

::

aNa_N bNb_N cNc_N

1 1
1 2 3
3 3
-1