#include <bits/stdc++.h>
using namespace std;
template <typename T, typename T1>
T maxn(T &a, T1 b) {
  if (b > a) a = b;
  return a;
}
template <typename T, typename T1>
T minn(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
vector<pair<pair<long long int, long long int>, long long int>> ans;
void solve() {
  long long int n, m, i = 2;
  cin >> n >> m;
  if (n == 2) {
    cout << "2 2"
         << "\n"
         << "1 2 2"
         << "\n";
    return;
  }
  for (long long int i = 2; i < n + 1; i++) ans.push_back({{1, i}, 1});
  ans[(long long int)ans.size() - 1].second = 2;
  ans[(long long int)ans.size() - 2].second = 100003 - n + 1;
  m -= (n - 1);
  while (m > 0) {
    for (long long int j = i + 1; j < n + 1; j++) {
      if (m > 0) {
        m--;
        ans.push_back({{i, j}, 1000000000});
      }
    }
    i++;
  }
  cout << "2 100003"
       << "\n";
  for (long long int(i) = 0; (i) < ((long long int)ans.size()); (i)++)
    cout << ans[i].first.first << " " << ans[i].first.second << " "
         << ans[i].second << "\n";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int testcase = 1;
  while (testcase--) solve();
  return 0;
}
