#include <bits/stdc++.h>
using tri = std::vector<std::vector<int64_t> >;
tri pascal(int nmax) {
  tri t(nmax + 1, {1});
  for (int n = 1; n <= nmax; n++) {
    for (int r = 1; r < n; r++) t[n].push_back(t[n - 1][r - 1] + t[n - 1][r]);
    t[n].push_back(1);
  }
  return t;
}
int64_t gridPaths(int w, int h, const tri& t) { return t[w + h - 2][w - 1]; }
using cell = std::pair<int, int>;
struct entry {
  int64_t paths;
  cell loc;
  bool down;
};
bool formBasis(std::vector<entry>& e, int64_t max) {
  std::sort(e.begin(), e.end(),
            [](entry a, entry b) { return a.paths < b.paths; });
  int64_t covered = 0;
  for (entry x : e) {
    int64_t maxNext = covered + 1;
    if (x.paths > maxNext) return false;
    covered += x.paths;
    if (covered >= max) return true;
  }
  return false;
}
int main() {
  const int widths[]{25, 10, 5};
  const int H = 50;
  const int W = 25 + 10 + 5 + 3;
  const int boxHeight = H - 2;
  const int64_t nmax = 1000000000000000000;
  const auto t = pascal(H * 2);
  std::vector<cell> lockDown, lockRight;
  std::vector<entry> e;
  int col = 0;
  for (int width : {25, 10, 5}) {
    for (int h = 1; h <= boxHeight; h++)
      e.push_back({gridPaths(width, h, t), {boxHeight + 1 - h, col}, false});
    for (int w = 1; w <= width; w++)
      e.push_back({gridPaths(w, boxHeight, t), {0, col + width + 1 - w}, true});
    for (int r = 1; r <= boxHeight; r++) {
      lockRight.emplace_back(r, col);
      if (col + width < W - 1) lockRight.emplace_back(r, col + width);
    }
    if (col == 0) lockRight.emplace_back(H - 1, width - 1);
    for (int c = col + 1; c <= col + width; c++) {
      lockDown.emplace_back(0, c);
      if (col != 0) lockDown.emplace_back(boxHeight, c - 1);
    }
    col += width + 1;
  }
  if (!formBasis(e, nmax)) throw new std::logic_error(">:[");
  int64_t n;
  std::cin >> n;
  for (auto i = e.crbegin(); i != e.crend(); ++i) {
    if (i->paths <= n) {
      n -= i->paths;
      auto& lockV = i->down ? lockDown : lockRight;
      lockV.erase(std::find(lockV.begin(), lockV.end(), i->loc));
    }
  }
  std::cout << H << ' ' << W << '\n'
            << lockRight.size() + lockDown.size() << '\n';
  for (cell x : lockRight)
    std::cout << x.first + 1 << ' ' << x.second + 1 << ' ' << x.first + 1 << ' '
              << x.second + 2 << '\n';
  for (cell x : lockDown)
    std::cout << x.first + 1 << ' ' << x.second + 1 << ' ' << x.first + 2 << ' '
              << x.second + 1 << '\n';
  return 0;
}
