#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int k = n;
  if (n == 2) {
    cout << 2 << " " << 2 << endl;
    cout << 1 << " " << 2 << " " << 2 << endl;
    return 0;
  }
  while (!isPrime(k)) k++;
  cout << 2 << " " << k << endl;
  int a = 2;
  cout << 1 << " " << n << " " << 2 << endl;
  while (a < n - 1) {
    cout << 1 << " " << a << " " << 1 << endl;
    a++;
  }
  cout << 1 << " " << a << " " << k - n + 1 << endl;
  a++;
  int i = 2;
  int l = a;
  a = 3;
  while (l <= m) {
    cout << i << " " << a << " " << 999999999 << endl;
    l++;
    a++;
    if (a > n) {
      i++;
      a = i + 1;
    }
  }
  return 0;
}
