#include <bits/stdc++.h>
using namespace std;
const int mx = 100111;
const int mod = 1000000007;
void error(bool flag) {
  cout << ((flag == 1) ? "NO" : "-1") << endl;
  exit(0);
}
const int N = 5e5 + 10;
bool prime[N];
void seive() {
  prime[1] = 1;
  for (int i = 4; i < N; i += 2) prime[i] = 1;
  for (int i = 3; i * i <= N; i += 2) {
    if (!prime[i]) {
      for (int j = i * i; j < N; j += 2 * i) {
        prime[j] = true;
      }
    }
  }
}
int main() {
  seive();
  int n, m;
  cin >> n >> m;
  int pri;
  for (int i = n;; i++) {
    if (!prime[i]) {
      pri = i;
      break;
    }
  }
  cout << "2 " << pri << endl;
  cout << "1 " << n << " 2" << endl;
  int p = n - 2;
  int val = pri - 2;
  if (val > p) {
    cout << "2 " << n << " " << val - p + 1 << endl;
    for (int i = 3; i < n; i++) {
      cout << n << " " << i << " 1" << endl;
    }
  } else {
    for (int i = 2; i < n; i++) {
      cout << n << " " << i << " 1" << endl;
    }
  }
  m -= n - 1;
  int t = 1;
  int qq = 2;
  while (m) {
    if (qq == n) {
      t++;
      qq = t + 1;
      continue;
    }
    m--;
    cout << t << " " << qq << " 900000000" << endl;
    qq++;
  }
  return 0;
}
