#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  cout << 100003 << " " << 100003 << "\n";
  cout << 1 << " " << 2 << " " << 100003 - n + 2 << "\n";
  for (long long i = 2; i <= n - 1; i++) {
    cout << i << " " << i + 1 << " " << 1 << "\n";
  }
  long long i = 1, j = 3;
  for (long long k = 1; k <= (m - (n - 1)); k++) {
    if (j <= n) {
      cout << i << " " << j << " " << 100000000 << "\n";
      j++;
    } else {
      i++;
      j = i + 2;
      cout << i << " " << j << " " << 100000000 << "\n";
      j++;
    }
  }
  return 0;
}
