#include <bits/stdc++.h>
using namespace std;
const int p = 100333;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  printf("%d %d\n", p, p);
  for (int i = 1; i < n - 1; i++) printf("%d %d 1\n", i, i + 1);
  printf("%d %d %d\n", n - 1, n, p - n + 2);
  int rest = m - n + 1;
  for (int i = 1; i <= n; i++)
    for (int j = i + 2; j <= n; j++) {
      if (!rest) return 0;
      printf("%d %d 1000000000\n", i, j);
      rest--;
    }
  return 0;
}
