#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 5;
ll a[N], b[N], c[N];
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n, k;
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		c[i] = k + 3 * n - 1 - i;
		if (2 * i < n) {
			a[i] = k + n / 2 + i;
			b[i] = k + 2 * n - 1 - 2 * i;
		} else {
			int p = (2 * i - n) / 2;
			a[i] = k + p;
			b[i] = k + 2 * n - 2 - 2 * p;
		}
		if (a[i] + b[i] > c[i])
			return cout << "-1", 0;
	}
	for (int i = 0; i < n; i++) {
		cout << a[i] << " " << b[i] << " " << c[i] << "\n";
	}
	return 0;
}