#include <bits/stdc++.h>
const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int N = 1e6 + 1;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  if (m == 1) {
    cout << "100003 100003" << endl;
    cout << "1 2 100003" << endl;
    return 0;
  }
  cout << "100003 100003" << endl;
  for (int i = 1; i < n - 1; i++) {
    cout << i << " " << i + 1 << " 1" << endl;
    m--;
  }
  cout << n - 1 << " " << n << " " << 100003 - n + 2 << endl;
  m--;
  long long int z = 1000000000;
  for (int i = 1; i < n && m > 0; i++) {
    for (int j = i + 2; j <= n && m > 0; j++) {
      cout << i << " " << j << " " << z << endl;
      m--;
    }
  }
  return 0;
}
