#include<bits/stdc++.h>

using namespace std;

#define N 1200000
#define ls (x<<1)
#define rs (x<<1|1)

int n,k,a[N],b[N],c[N];

int main(){
	scanf("%d%d",&n,&k);
	for (int i=0;i<n;++i){
		a[i]=k+i;
		b[i]=k+n+i;
		c[i]=k+n*2+i;
	}
	if (n&1){
		int x=a[0],y=b[n/2],z=c[0];
		if (x+y>z){puts("-1"); return 0;}
		if (n>1){
			x=a[n/2+1],y=b[0],z=c[1];
			if (x+y>z){puts("-1"); return 0;}
		}
		for (int i=0;i<=n/2;++i){
			int x=a[i],y=b[i+n/2],z=c[i*2];
			printf("%d %d %d\n",x,y,z);
		}
		for (int i=0;i<n/2;++i){
			int x=a[i+n/2+1],y=b[i],z=c[i*2+1];
			printf("%d %d %d\n",x,y,z);
		}
	}
	else{
		int x=a[0],y=b[n/2],z=c[0];
		if (x+y>z){puts("-1"); return 0;}
		for (int i=0;i<n/2;++i){
			int x=a[i],y=b[i+n/2],z=c[i*2];
			printf("%d %d %d\n",x,y,z);
		}
		for (int i=0;i<n/2;++i){
			int x=a[i+n/2],y=b[i],z=c[i*2+1];
			printf("%d %d %d\n",x,y,z);
		}
	}
	
	return 0;
}
			