#include <bits/stdc++.h>
using namespace std;
const int prime = 100003;
int main() {
  int n, m;
  cin >> n >> m;
  int last = m - n + 1;
  cout << prime << " " << prime << endl;
  cout << "1 2 " << prime - n + 2 << endl;
  for (int i = 2; i <= n - 1; i++)
    cout << i << " " << i + 1 << " " << 1 << endl;
  for (int i = 1; i <= n - 1; i++)
    for (int j = i + 2; j <= n; j++) {
      if (last == 0) return 0;
      last--;
      cout << i << " " << j << " " << prime << endl;
    }
}
