#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int ans[maxn], num[maxn];
int main() {
  int k, h, m, n, i, j;
  long long x;
  while (cin >> n >> m) {
    int prime = 100019;
    cout << prime << ' ' << prime << endl;
    for (i = 1; i < n - 1; i++) cout << i << ' ' << i + 1 << " 1" << endl;
    if (m == n - 1)
      cout << n - 1 << ' ' << n << ' ' << prime - (n - 2) << endl;
    else {
      cout << n - 1 << ' ' << n << ' ' << prime - (n - 2) << endl;
      int now = 1, cnt = 2;
      int tot = n - 1;
      for (j = 2; j <= n - 1; j++) {
        for (i = 1; i + j <= n; i++) {
          if (tot == m) break;
          cout << i << ' ' << i + j << ' ' << prime << endl;
          tot++;
        }
        if (tot == m) break;
      }
    }
  }
  return 0;
}
