#include <bits/stdc++.h>

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n, k;
  cin >> n >> k;
  if (n < 2 * k - 1) {
    cout << -1 << endl;
    return 0;
  }

  vector<int> xs(n);
  vector<int> ys(n);
  vector<int> zs(n);

  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      xs[i] = k + i / 2;
      ys[i] = k + n + (n / 2) + i / 2;
    } else {
      xs[i] = k + ((n + 1) / 2) + i / 2;
      ys[i] = k + n + i / 2;
    }
    zs[i] = k + 2 * n + i;
  }

  for (int i = 0; i < n; i++) {
    cout << xs[i] << " " << ys[i] << " " << zs[i] << endl;
  }
}