#include <bits/stdc++.h>
using namespace std;
int pr, a, b;
int v[1000009];
int main() {
  cin >> a >> b;
  for (int i = 2; i <= 1000000; i++)
    for (int j = i * 2; j <= 1000000; j += i) v[j] = 1;
  for (int i = max(a - 1, 2); i < 1000000; i++)
    if (v[i] == 0) {
      pr = i;
      break;
    }
  cout << pr << " " << pr << endl;
  for (int i = 1; i < a - 1; i++) cout << i << " " << i + 1 << " 1" << endl;
  cout << a - 1 << " " << a << " " << pr - a + 2 << endl;
  for (int i = 1; i <= a; i++)
    for (int j = i + 2; j <= a; j++) {
      if (b == a - 1)
        return 0;
      else
        cout << i << " " << j << " " << pr + 1 << endl;
      b--;
    }
}
