#include <bits/stdc++.h>
using namespace std;
long long power(long long, long long);
long long mpower(long long, long long);
int p = 100271;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  cout << p << " " << p << endl;
  cout << 1 << " " << 2 << " " << p - n + 2 << endl;
  for (int i = 1; i <= n - 2; i++) {
    cout << i + 1 << " " << i + 2 << " " << 1 << endl;
  }
  int a = 1, b = 3;
  for (int i = 1; i <= (m - n + 1); i++) {
    cout << a << " " << b << " " << p + 200 << endl;
    b++;
    if (b > n) {
      a++;
      b = a + 2;
    }
  }
  return 0;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = res * a;
    a = a * a;
    b = b / 2;
  }
  return res;
}
long long mpower(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b = b / 2;
  }
  return res;
}
