#include <bits/stdc++.h>
using namespace std;
long long int DP[10000];
int main() {
  int n, m;
  cin >> n >> m;
  int prime = 100003;
  cout << prime << " " << prime << endl;
  for (int i = 0; i < n - 2; i++) {
    cout << i + 1 << " " << i + 2 << " 1" << endl;
    prime--;
  }
  cout << n - 1 << " " << n << " " << prime << endl;
  m -= n - 1;
  for (int i = 0; i < n; i++) {
    for (int j = i + 2; j < n && m > 0; j++) {
      cout << i + 1 << " " << j + 1 << " " << 200000 << endl;
      m--;
    }
  }
  return 0;
}
