#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int i;
  cin >> n;
  cin >> m;
  printf("100003 100003\n");
  printf("1 2 %d\n", 100003 - n + 2);
  for (i = 2; i < n; ++i) {
    printf("%d %d 1\n", i, i + 1);
  }
  m = m - n + 1;
  int c1 = 1, c2 = 3;
  while (m > 0) {
    if (c2 > n) {
      c1++;
      c2 = c1 + 2;
    }
    m--;
    printf("%d %d 10000000\n", c1, c2);
    c2++;
  }
}
