#include <bits/stdc++.h>
using namespace std;
vector<long long int> v;
int main() {
  long long int t = 1, n, m, i, j, k, sum = 0, ans = 0;
  string s;
  cin >> n >> m;
  cout << 100003 << " " << 100003 << "\n";
  for (i = 1; i < n - 1; i++) {
    cout << i << " " << i + 1 << " 1\n";
  }
  cout << n - 1 << " " << n << " " << (100003 - (n - 2)) << "\n";
  m = m - (n - 1);
  for (i = 1; i < n; i++) {
    for (j = i + 2; j <= n; j++) {
      if (!m) break;
      cout << i << " " << j << " " << 100003 << "\n";
      m--;
    }
    if (!m) break;
  }
  return 0;
}
