#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, b[200000 + 10] = {0}, h, f;
  cin >> n >> k;
  if (2 * k > n + 1)
    cout << -1 << endl;
  else {
    for (long long i = k; i <= k + 3 * n - 1; i++) {
      b[i] = 1;
    }
    h = 2 * n - 1 + k;
    f = 3 * n - 1 + k - h;
    for (long long j = 3 * n - 1 + k; j >= 2 * n + k; j--) {
      f = j - h;
      if (b[h] != 0 && b[f] != 0) {
        cout << f << " " << h << " " << j << endl;
        b[h] = 0;
        b[f] = 0;
        h--;
      } else {
        h--;
      }
    }
  }
}
