#include <bits/stdc++.h>
using namespace std;
const int MAXN = 55;
int n, m, cnt;
long long v;
int p[MAXN];
void calc(int v) {
  if (!v)
    cnt += 4;
  else if (v == 1 || v == 3)
    cnt += 3;
  else if (v == 2 || v == 4)
    cnt += 2;
  else
    cnt += 1;
  return;
}
void slv(int tmp, int v) {
  if (v == 0) {
    printf("%d %d %d %d\n", tmp - 1, tmp + 1, tmp, tmp + 1);
    printf("%d %d %d %d\n", tmp - 1, tmp + 2, tmp, tmp + 2);
    printf("%d %d %d %d\n", tmp + 1, tmp - 1, tmp + 1, tmp);
    printf("%d %d %d %d\n", tmp + 2, tmp - 1, tmp + 2, tmp);
    return;
  }
  if (v == 1) {
    printf("%d %d %d %d\n", tmp - 1, tmp + 1, tmp, tmp + 1);
    printf("%d %d %d %d\n", tmp - 1, tmp + 2, tmp, tmp + 2);
    printf("%d %d %d %d\n", tmp + 1, tmp - 1, tmp + 1, tmp);
    return;
  }
  if (v == 2) {
    printf("%d %d %d %d\n", tmp - 1, tmp + 1, tmp, tmp + 1);
    printf("%d %d %d %d\n", tmp + 1, tmp - 1, tmp + 1, tmp);
    return;
  }
  if (v == 3) {
    printf("%d %d %d %d\n", tmp - 1, tmp + 2, tmp, tmp + 2);
    printf("%d %d %d %d\n", tmp + 1, tmp - 1, tmp + 1, tmp);
    printf("%d %d %d %d\n", tmp + 2, tmp - 1, tmp + 2, tmp);
    return;
  }
  if (v == 4) {
    printf("%d %d %d %d\n", tmp + 1, tmp - 1, tmp + 1, tmp);
    printf("%d %d %d %d\n", tmp + 2, tmp - 1, tmp + 2, tmp);
    return;
  }
  printf("%d %d %d %d\n", tmp - 1, tmp + 1, tmp, tmp + 1);
  return;
}
int main() {
  scanf("%lld", &v);
  while (v) p[++p[0]] = v % 6, v /= 6;
  n = m = p[0] + 1 << 1;
  cnt = 2;
  printf("%d %d\n", n, m);
  for (int i = 1; i <= p[0]; ++i) {
    int tmp = n - (i << 1);
    if (i != 1) cnt += 8;
    calc(p[i]);
  }
  printf("%d\n", cnt);
  for (int i = 1; i <= p[0]; ++i) {
    int tmp = n - (i << 1);
    if (i != 1) {
      printf("%d %d %d %d\n", tmp, tmp + 3, tmp, tmp + 4);
      printf("%d %d %d %d\n", tmp - 1, tmp + 3, tmp - 1, tmp + 4);
      printf("%d %d %d %d\n", tmp + 3, tmp, tmp + 4, tmp);
      printf("%d %d %d %d\n", tmp + 3, tmp - 1, tmp + 4, tmp - 1);
      printf("%d %d %d %d\n", tmp + 2, tmp, tmp + 3, tmp);
      printf("%d %d %d %d\n", tmp + 2, tmp + 1, tmp + 3, tmp + 1);
      printf("%d %d %d %d\n", tmp, tmp + 2, tmp, tmp + 3);
      printf("%d %d %d %d\n", tmp + 1, tmp + 2, tmp + 1, tmp + 3);
    }
    slv(tmp, p[i]);
  }
  puts("1 2 2 2");
  puts("2 1 2 2");
  return 0;
}
