//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
using namespace std;
ll N,K;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>N>>K;
	if(K<=(N+1)/2){
		if(N%2){
			REP(i,(N-1)/2){
				cout<<K+i<<' '<<K+(3*N+1)/2+i<<' '<<K+2*N+1+2*i<<endl;
			}
			REP(i,(N-1)/2+1){
				cout<<K+(N-1)/2+i<<' '<<K+N+i<<' '<<K+2*N+2*i<<endl;
			}
		}else{
			REP(i,N/2){
				cout<<K+i<<' '<<K+3*N/2+i<<' '<<K+2*N+1+2*i<<endl;
			}
			REP(i,N/2){
				cout<<K+N/2+i<<' '<<K+N+i<<' '<<K+2*N+2*i<<endl;
			}
		}
	}else{
		cout<<-1<<endl;
	}
}