#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
inline void read(long long &x) {
  char ch;
  bool flag = false;
  for (ch = getchar(); !isdigit(ch); ch = getchar())
    if (ch == '-') flag = true;
  for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar())
    ;
  x = flag ? -x : x;
}
int n, m;
bool vis[300000];
int su[300000], cnt;
int nex[300000];
void prepare() {
  for (int i = 2; i < 300000; i++) {
    if (vis[i] == 0) su[++cnt] = i;
    for (int j = 1; j <= cnt; j++) {
      if (1ll * su[j] * i >= 300000) break;
      vis[su[j] * i] = 1;
      if (i * su[j] == 0) break;
    }
  }
  int now = su[cnt];
  for (int i = 300000 - 1; i >= 1; i--) {
    if (vis[i] == 0) now = i;
    nex[i] = now;
  }
}
int main() {
  prepare();
  read(n);
  read(m);
  printf("%d %d\n", nex[n + 1], nex[n + 1]);
  for (int i = 2; i < n; i++) printf("%d %d %d\n", i - 1, i, 1);
  printf("%d %d %d\n", n - 1, n, nex[n + 1] - n + 2);
  int x, y;
  x = 1;
  y = 3;
  for (int i = n; i <= m; i++) {
    printf("%d %d %d\n", x, y, 100000000);
    y++;
    if (y > n) {
      x++;
      y = x + 2;
    }
  }
  return 0;
}
