#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n, m;
  cin >> n >> m;
  cout << 100003 << ' ' << 100003 << "\n";
  cout << "1 2 " << 100003 - (n - 2) << "\n";
  for (int i = 1; i < n - 1; i++) {
    cout << i + 1 << " " << i + 2 << " 1\n";
  }
  int rem = m - (n - 1);
  int low = 1;
  int high = 3;
  for (int i = 0; i < rem; i++) {
    cout << low << ' ' << high << ' ' << 100000000 << "\n";
    high++;
    if (high > n) {
      low++;
      high = low + 2;
    }
  }
  return 0;
}
