#include <bits/stdc++.h>
using namespace std;
const int maxw = 100003;
const int INF = 1e9;
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  cout << maxw << " " << maxw << endl;
  cout << 1 << " " << 2 << " " << maxw - (n - 2) << endl;
  for (int i = 2; i < n; i++) {
    cout << i << " " << i + 1 << " " << 1 << endl;
  }
  int v = 1, u = 3;
  for (int i = 0; i < m - n + 1; i++) {
    cout << v << " " << u << " " << INF << endl;
    u++;
    if (u > n) {
      v++;
      u = v + 2;
    }
  }
  return 0;
}
