#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gcd(T a, T b) {
  T c;
  while (b) {
    c = b;
    b = a % b;
    a = c;
  }
  return a;
}
void err(istream_iterator<string>) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
template <typename T>
ostream &print(ostream &out, T const &val) {
  return (out << val << " ");
}
template <typename T1, typename T2>
ostream &print(ostream &out, pair<T1, T2> const &val) {
  return (out << "{" << val.first << " " << val.second << "} ");
}
template <template <typename, typename...> class TT, typename... Args>
ostream &operator<<(ostream &out, TT<Args...> const &cont) {
  for (auto elem : cont) print(out, elem);
  return out;
}
const double PI = acos(-1);
const long long MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const int N = 1000000;
int n, m;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  int re = 1000003;
  int prev = 1;
  cout << re << " " << re << "\n";
  for (int i = 1; i < n - 1; i++) {
    cout << prev << " " << i + 1 << " " << 1 << "\n";
    prev++;
    m--;
    re--;
  }
  cout << n - 1 << " " << n << " " << re << "\n";
  m--;
  prev = 1;
  int now = n - 1;
  while (m >= 0) {
    if (m <= 0) break;
    for (int i = prev + 2; i <= n; i++, now++) {
      cout << prev << " " << i << " " << 1000000000 << "\n";
      now++;
      m--;
      if (m <= 0) break;
    }
    prev++;
    if (m <= 0) break;
  }
  return 0;
}
