#include <bits/stdc++.h>
using namespace std;
void read(bool out = 0) {}
int main() {
  long long n, m;
  cin >> n >> m;
  if (n == 2) {
    cout << 2 << " " << 2 << "\n";
    cout << 1 << " " << 2 << " " << 2;
    cout << "\n";
    return 0;
  }
  long long prim = 16769023;
  long long sv = prim;
  vector<pair<long long, pair<long long, long long> > > ans;
  for (int i = n; i > 1; i--, m--) {
    if (i == n) {
      ans.push_back(make_pair(1, make_pair(i, 2)));
      prim -= 2;
    } else if (i != 2) {
      ans.push_back(make_pair(1, make_pair(i, 50)));
      prim -= 50;
    } else {
      ans.push_back(make_pair(1, make_pair(i, prim)));
    }
  }
  for (int i = 2; m && i <= n; i++) {
    for (int j = i + 1; m && j <= n; j++, m--) {
      ans.push_back(make_pair(i, make_pair(j, 1e9)));
    }
  }
  cout << 2 << " " << sv << "\n";
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second.first << " "
         << ans[i].second.second;
    cout << "\n";
  }
}
