#include <bits/stdc++.h>
using namespace std;
int II() {
  int q;
  scanf("%d", &q);
  return q;
}
long long LII() {
  long long q;
  scanf("%lld", &q);
  return q;
}
void solve() {
  int N, M;
  cin >> N >> M;
  int q = 500009;
  if (M == 1) {
    cout << q << " " << q << endl;
    cout << 1 << " " << N << " " << q << endl;
    return;
  }
  cout << 2 << " " << q << endl;
  cout << 1 << " " << N << " " << 2 << endl;
  M--;
  q -= 2;
  for (int i = 2; i < N - 1; i++) {
    cout << 1 << " " << i << " " << 1 << endl;
    q--;
    M--;
  }
  if ((N - 1) > 1) {
    cout << 1 << " " << N - 1 << " " << q << endl;
    M--;
  }
  for (int i = 2; i <= N && M > 0; i++) {
    for (int j = i + 1; j <= N && M > 0; j++) {
      cout << i << " " << j << " " << 10000000 << endl;
      M--;
    }
  }
}
int32_t main() {
  int tt;
  tt = 1;
  int cas = 1;
  while (tt--) {
    solve();
  }
}
