#include <bits/stdc++.h>
using namespace std;
long long t;
int n, k;
struct node {
  int x_1, y_1, x_2, y_2;
};
int q[30];
vector<node> s;
void add(int n, int w) {
  if (w == 0) {
    s.push_back((node){n - 1, n + 1, n, n + 1});
    s.push_back((node){n - 1, n + 2, n, n + 2});
    s.push_back((node){n + 1, n - 1, n + 1, n});
    s.push_back((node){n + 2, n - 1, n + 2, n});
  }
  if (w == 1) {
    s.push_back((node){n - 1, n + 1, n, n + 1});
    s.push_back((node){n + 1, n - 1, n + 1, n});
    s.push_back((node){n + 2, n - 1, n + 2, n});
  }
  if (w == 2) {
    s.push_back((node){n - 1, n + 1, n, n + 1});
    s.push_back((node){n + 1, n - 1, n + 1, n});
  }
  if (w == 3) {
    s.push_back((node){n - 1, n + 2, n, n + 2});
    s.push_back((node){n + 1, n - 1, n + 1, n});
    s.push_back((node){n + 2, n - 1, n + 2, n});
  }
  if (w == 4) {
    s.push_back((node){n + 1, n - 1, n + 1, n});
    s.push_back((node){n + 2, n - 1, n + 2, n});
  }
  if (w == 5) {
    s.push_back((node){n + 1, n - 1, n + 1, n});
  }
}
int main() {
  s.clear();
  scanf("%lld", &t);
  while (t) q[++q[0]] = t % 6, t /= 6;
  int n = 2, k = 0;
  s.push_back((node){2, 1, 2, 2});
  s.push_back((node){1, 2, 2, 2});
  while (q[0]) {
    add(n, q[q[0]]);
    q[0]--;
    if (!q[0]) {
      n += 2;
      break;
    }
    s.push_back((node){n - 1, n + 3, n - 1, n + 4});
    s.push_back((node){n, n + 3, n, n + 4});
    s.push_back((node){n + 3, n - 1, n + 4, n - 1});
    s.push_back((node){n + 3, n, n + 4, n});
    s.push_back((node){n, n + 2, n, n + 3});
    s.push_back((node){n + 1, n + 2, n + 1, n + 3});
    s.push_back((node){n + 2, n, n + 3, n});
    s.push_back((node){n + 2, n + 1, n + 3, n + 1});
    n += 2;
  }
  printf("%d %d\n%d\n", n, n, s.size());
  for (int i = 0, end = s.size(); i < end; i++) {
    printf("%d %d %d %d\n", s[i].x_1, s[i].y_1, s[i].x_2, s[i].y_2);
  }
}
