#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  long long n, m;
  cin >> n >> m;
  cout << "335411 335411" << endl;
  for (int i = 1; i <= n - 2; ++i)
    cout << i << ' ' << i + 1 << ' ' << 1 << endl;
  cout << n - 1 << ' ' << n << ' ' << 335411 - n + 2 << endl;
  m = m - (n - 1);
  for (int i = 1; i <= n && m > 0; i++)
    for (int j = i + 2; j <= n && m > 0; j++) {
      m--;
      cout << i << ' ' << j << " 1000000000" << endl;
    }
  return 0;
}
