#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pii;
typedef double ld;
typedef pair<ld, ld> pdd;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

struct Tri{ 
  ll ai;
  ll bi;
  bool operator< (const Tri &F) const {
    return (ai + bi) < (F.ai + F.bi);
  }
};

int main(){
  fastIO;
  ll k;
  int n;
  cin >> n >> k;
  if(2 * k - 1 > n){
    cout << "-1\n";
    return 0;
  }
  vector<Tri> sol(n);
  int d = n/2;
  for(int i = 0 ; i < n; i ++ ){
    sol[i].ai = k + i;
    sol[i].bi = k + n + (i + n - d) % n;
  }
  /*
  if(n > 1){
    swap(sol[n-2].bi, sol[n-1].bi);
  }
  */
  sort(sol.begin(), sol.end());
  for(int i = 0 ; i < n; i ++ ){
    cout << sol[i].ai << " " << sol[i].bi << " " << k + 2 * n + i << "\n";
  }
  return 0;
}
