#include <bits/stdc++.h>
using namespace std;
const int maxn = 500010, inf = 1e9, mod = 1e9 + 7;
struct edge {
  int x1, y1, x2, y2;
} ans[maxn];
int n, m, anscnt, cnt;
int digit[maxn];
long long T;
inline void read(int &k) {
  int f = 1;
  k = 0;
  char c = getchar();
  while (c < '0' || c > '9') c == '-' && (f = -1), c = getchar();
  while (c <= '9' && c >= '0') k = k * 10 + c - '0', c = getchar();
  k *= f;
}
int main() {
  scanf("%I64d", &T);
  while (T) digit[++cnt] = T % 6, T /= 6;
  ans[++anscnt] = (edge){1, 2, 2, 2};
  ans[++anscnt] = (edge){2, 1, 2, 2};
  int x = 2, y = 2;
  for (int i = cnt; i; i--) {
    ans[++anscnt] = (edge){x + 1, y - 1, x + 1, y};
    if (i != cnt)
      ans[++anscnt] = (edge){x + 2, y - 2, x + 2, y - 1},
      ans[++anscnt] = (edge){x - 2, y + 2, x - 1, y + 2};
    if (i != 1) {
      ans[++anscnt] = (edge){x + 1, y + 2, x + 1, y + 3};
      ans[++anscnt] = (edge){x, y + 2, x, y + 3};
      ans[++anscnt] = (edge){x + 2, y, x + 3, y};
      ans[++anscnt] = (edge){x + 2, y + 1, x + 3, y + 1};
      if (i != cnt)
        ans[++anscnt] = (edge){x + 3, y - 2, x + 3, y - 1},
        ans[++anscnt] = (edge){x - 2, y + 3, x - 1, y + 3};
    }
    if (digit[i] < 3)
      ans[++anscnt] = (edge){x - 1, y + 1, x, y + 1};
    else
      digit[i] -= 3;
    if (!digit[i])
      ans[++anscnt] = (edge){x - 1, y + 2, x, y + 2};
    else
      digit[i]--;
    if (!digit[i])
      ans[++anscnt] = (edge){x + 2, y - 1, x + 2, y};
    else
      digit[i]--;
    x += 2;
    y += 2;
  }
  printf("%d %d\n", x, y);
  printf("%d\n", anscnt);
  for (int i = 1; i <= anscnt; i++)
    printf("%d %d %d %d\n", ans[i].x1, ans[i].y1, ans[i].x2, ans[i].y2);
}
