#include <bits/stdc++.h>
using namespace std;
long long small = 1298173;
int n, m, a = 1, b = 2;
void step() {
  if (a == 1 and b == n - 1) {
    a++;
    b = a + 1;
  } else if (b < n) {
    b++;
  } else {
    a++;
    b = a + 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cin >> n >> m;
  if (m == 1) {
    cout << "2 2\n";
    cout << "1 " << n << " 2\n";
    return 0;
  }
  cout << 2 << " " << small << '\n';
  cout << 1 << " " << n << " 2" << '\n';
  small -= 2;
  int counter = n - 2;
  while (counter > 1) {
    cout << a << " " << b << " " << 10 << '\n';
    small -= 10;
    step();
    counter--;
  }
  cout << a << " " << b << " " << small << '\n';
  step();
  m -= (n - 1);
  while (m > 0) {
    cout << a << " " << b << " " << 1298183 << '\n';
    step();
    m--;
  }
  return 0;
}
