#include <bits/stdc++.h>
using namespace std;
long long t;
struct Edge {
  int x1, y1, x2, y2;
  Edge(int x1 = 0, int y1 = 0, int x2 = 0, int y2 = 0)
      : x1(x1), y1(y1), x2(x2), y2(y2) {}
} e[10000 + 10];
int tail = 0;
int dep = 0;
void dfs(long long x) {
  if (x <= 6) {
    if (x == 1) {
      e[tail++] = Edge(1, 2, 2, 2);
      dep += 2;
    } else {
      if (x == 2) {
        e[tail++] = Edge(2, 3, 3, 3);
        e[tail++] = Edge(3, 1, 3, 2);
      }
      if (x == 3) {
        e[tail++] = Edge(2, 3, 3, 3);
      }
      if (x == 4) {
        e[tail++] = Edge(1, 3, 2, 3);
        e[tail++] = Edge(3, 1, 3, 2);
      }
      if (x == 5) {
        e[tail++] = Edge(3, 1, 3, 2);
      }
      dep += 3;
    }
    return;
  }
  dfs(x / 6);
  if (x >= 36 * 6) {
    e[tail++] = Edge(dep + 1, dep - 4, dep + 1, dep - 3);
    e[tail++] = Edge(dep + 2, dep - 2, dep + 2, dep - 1);
    e[tail++] = Edge(dep, dep - 2, dep + 1, dep - 2);
    e[tail++] = Edge(dep, dep - 1, dep + 1, dep - 1);
    e[tail++] = Edge(dep - 4, dep + 1, dep - 3, dep + 1);
    e[tail++] = Edge(dep - 2, dep + 2, dep - 1, dep + 2);
    e[tail++] = Edge(dep - 2, dep, dep - 2, dep + 1);
    e[tail++] = Edge(dep - 1, dep, dep - 1, dep + 1);
  } else
    for (int i = 2; i <= dep - 1; i++) {
      e[tail++] = Edge(dep + 1, i, dep + 2, i);
      e[tail++] = Edge(i, dep + 1, i, dep + 2);
      e[tail++] = Edge(i, dep, i, dep + 1);
    }
  x = x % 6;
  if (x == 0) {
    e[tail++] = Edge(dep + 1, dep - 1, dep + 1, dep);
    e[tail++] = Edge(dep + 2, dep - 1, dep + 2, dep);
    e[tail++] = Edge(dep - 1, dep + 1, dep, dep + 1);
    e[tail++] = Edge(dep - 1, dep + 2, dep, dep + 2);
  }
  if (x == 1) {
    e[tail++] = Edge(dep + 1, dep - 1, dep + 1, dep);
    e[tail++] = Edge(dep - 1, dep + 1, dep, dep + 1);
    e[tail++] = Edge(dep - 1, dep + 2, dep, dep + 2);
  }
  if (x == 2) {
    e[tail++] = Edge(dep + 1, dep - 1, dep + 1, dep);
    e[tail++] = Edge(dep - 1, dep + 1, dep, dep + 1);
  }
  if (x == 3) {
    e[tail++] = Edge(dep + 1, dep - 1, dep + 1, dep);
    e[tail++] = Edge(dep + 2, dep - 1, dep + 2, dep);
    e[tail++] = Edge(dep - 1, dep + 2, dep, dep + 2);
  }
  if (x == 4) {
    e[tail++] = Edge(dep + 1, dep - 1, dep + 1, dep);
    e[tail++] = Edge(dep + 2, dep - 1, dep + 2, dep);
  }
  if (x == 5) {
    e[tail++] = Edge(dep + 1, dep - 1, dep + 1, dep);
  }
  dep += 2;
}
int main() {
  cin >> t;
  dfs(t);
  printf("%d %d\n", dep, dep);
  printf("%d\n", tail);
  for (int i = 0; i < tail; i++)
    printf("%d %d %d %d\n", e[i].x1, e[i].y1, e[i].x2, e[i].y2);
  return 0;
}
