#include <bits/stdc++.h>
using namespace std;
using INT = long long;
using pii = pair<int, int>;
using ppp = pair<pii, pii>;
vector<ppp> vec;
bool vst[44][44][44][44];
void del_1(int i) { vst[i + 1][i + 3][i + 1][i + 4] = 1; }
void del_2(int i) { vst[i + 3][i + 1][i + 4][i + 1] = 1; }
int main() {
  INT t;
  scanf("%I64d", &t);
  for (int i = 0; t; i++) {
    int first = t % 3;
    if (first--) {
      del_1(i);
      if (first) del_2(i);
    }
    t /= 3;
  }
  int n = 41;
  vec.push_back({{n - 2, n - 1}, {n - 2, n}});
  vec.push_back({{n - 1, n - 1}, {n - 1, n}});
  for (int i = 1; i <= n - 3; i++) vec.push_back({{i, i + 2}, {i, i + 3}});
  for (int i = 4; i <= n - 1; i++) vec.push_back({{i - 3, i}, {i - 2, i}});
  for (int i = 1; i <= n - 5; i++) vec.push_back({{i, i + 4}, {i, i + 5}});
  for (int i = 6; i <= n; i++) vec.push_back({{i - 5, i}, {i - 4, i}});
  vec.push_back({{n - 1, n - 2}, {n, n - 2}});
  vec.push_back({{n - 1, n - 1}, {n, n - 1}});
  for (int i = 1; i <= n - 3; i++) vec.push_back({{i + 2, i}, {i + 3, i}});
  for (int i = 4; i <= n - 1; i++) vec.push_back({{i, i - 3}, {i, i - 2}});
  for (int i = 1; i <= n - 5; i++) vec.push_back({{i + 4, i}, {i + 5, i}});
  for (int i = 6; i <= n; i++) vec.push_back({{i, i - 5}, {i, i - 4}});
  int ans = 0;
  for (ppp p : vec) {
    if (!vst[p.first.first][p.first.second][p.second.first][p.second.second])
      ans++;
  }
  printf("%d %d\n", n, n);
  printf("%d\n", ans);
  for (ppp p : vec)
    if (!vst[p.first.first][p.first.second][p.second.first][p.second.second]) {
      printf("%d %d %d %d\n", p.first.first, p.first.second, p.second.first,
             p.second.second);
    }
}
