#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
struct node {
  int x1, y1_, x2, y2;
  node() {}
  node(int _x1, int _y1, int _x2, int _y2) {
    x1 = _x1;
    y1_ = _y1;
    x2 = _x2;
    y2 = _y2;
  }
} a[305];
int n, k;
void add(int s, int w) {
  if (w == 0) {
    a[++k] = node(s - 1, s + 1, s, s + 1);
    a[++k] = node(s - 1, s + 2, s, s + 2);
    a[++k] = node(s + 1, s - 1, s + 1, s);
    a[++k] = node(s + 2, s - 1, s + 2, s);
  } else if (w == 1) {
    a[++k] = node(s - 1, s + 1, s, s + 1);
    a[++k] = node(s + 1, s - 1, s + 1, s);
    a[++k] = node(s + 2, s - 1, s + 2, s);
  } else if (w == 2) {
    a[++k] = node(s - 1, s + 1, s, s + 1);
    a[++k] = node(s + 1, s - 1, s + 1, s);
  } else if (w == 3) {
    a[++k] = node(s - 1, s + 2, s, s + 2);
    a[++k] = node(s + 1, s - 1, s + 1, s);
    a[++k] = node(s + 2, s - 1, s + 2, s);
  } else if (w == 4) {
    a[++k] = node(s + 1, s - 1, s + 1, s);
    a[++k] = node(s + 2, s - 1, s + 2, s);
  } else if (w == 5) {
    a[++k] = node(s + 1, s - 1, s + 1, s);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long T = read();
  stack<int> s;
  while (T) {
    s.push(T % 6LL);
    T /= 6LL;
  }
  n = 2, k = 0;
  a[++k] = node(2, 1, 2, 2);
  a[++k] = node(1, 2, 2, 2);
  while (!s.empty()) {
    add(n, s.top());
    s.pop();
    if (!s.empty()) {
      a[++k] = node(n - 1, n + 3, n - 1, n + 4);
      a[++k] = node(n, n + 3, n, n + 4);
      a[++k] = node(n + 3, n - 1, n + 4, n - 1);
      a[++k] = node(n + 3, n, n + 4, n);
      a[++k] = node(n, n + 2, n, n + 3);
      a[++k] = node(n + 1, n + 2, n + 1, n + 3);
      a[++k] = node(n + 2, n, n + 3, n);
      a[++k] = node(n + 2, n + 1, n + 3, n + 1);
    }
    n += 2;
  }
  cout << n << " " << n << endl;
  cout << k << endl;
  for (int i = 1; i <= k; ++i)
    cout << a[i].x1 << " " << a[i].y1_ << " " << a[i].x2 << " " << a[i].y2
         << endl;
  return 0;
}
