#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, m;
  cin >> n >> m;
  cout << 100003 << " " << 100003 << '\n';
  for (int i = 1; i < n - 1; ++i) printf("%d %d %d\n", i, i + 1, 1);
  printf("%d %d %d\n", n - 1, n, 100003 - n + 2);
  int i = 1;
  m -= (n - 1);
  while (m > 0) {
    int j = i + 2;
    for (int l = 0; l < min(m, n - i - 1); ++l)
      printf("%d %d %d\n", i, j++, 100004);
    m -= (n - i - 1);
    i++;
  }
  return;
}
int main() {
  solve();
  return 0;
}
