#include <bits/stdc++.h>
using namespace std;
int IN() {
  int c, f, x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
long long T;
int n, m, A[100];
vector<pair<pair<int, int>, pair<int, int> > > V;
int main() {
  scanf("%I64d", &T);
  n = 4, m = 4;
  for (; T; T /= 6) A[++*A] = T % 6;
  switch (A[*A]) {
    case 0: {
      V.push_back(make_pair(make_pair(4, 3), make_pair(4, 4)));
      V.push_back(make_pair(make_pair(3, 4), make_pair(4, 4)));
      break;
    }
    case 1: {
      V.push_back(make_pair(make_pair(2, 3), make_pair(2, 4)));
      V.push_back(make_pair(make_pair(3, 3), make_pair(3, 4)));
      V.push_back(make_pair(make_pair(4, 3), make_pair(4, 4)));
      break;
    }
    case 2: {
      V.push_back(make_pair(make_pair(3, 2), make_pair(4, 2)));
      V.push_back(make_pair(make_pair(3, 3), make_pair(4, 3)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(2, 4)));
      V.push_back(make_pair(make_pair(3, 3), make_pair(3, 4)));
      break;
    }
    case 3: {
      V.push_back(make_pair(make_pair(2, 2), make_pair(3, 2)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(3, 3)));
      V.push_back(make_pair(make_pair(2, 4), make_pair(3, 4)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(2, 4)));
      V.push_back(make_pair(make_pair(4, 1), make_pair(4, 2)));
      break;
    }
    case 4: {
      V.push_back(make_pair(make_pair(2, 2), make_pair(3, 2)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(3, 3)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(2, 4)));
      V.push_back(make_pair(make_pair(4, 1), make_pair(4, 2)));
      break;
    }
    case 5: {
      V.push_back(make_pair(make_pair(2, 2), make_pair(3, 2)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(3, 3)));
      V.push_back(make_pair(make_pair(2, 3), make_pair(2, 4)));
      break;
    }
  }
  for (int i = (*A) - 1; i; i--) {
    n += 2, m += 2;
    V.push_back(make_pair(make_pair(n - 2, m - 4), make_pair(n - 1, m - 4)));
    V.push_back(make_pair(make_pair(n - 2, m - 3), make_pair(n - 1, m - 3)));
    V.push_back(make_pair(make_pair(n - 1, m - 5), make_pair(n, m - 5)));
    V.push_back(make_pair(make_pair(n - 1, m - 4), make_pair(n, m - 4)));
    V.push_back(make_pair(make_pair(n - 5, m - 1), make_pair(n - 5, m)));
    V.push_back(make_pair(make_pair(n - 4, m - 1), make_pair(n - 4, m)));
    V.push_back(make_pair(make_pair(n - 4, m - 2), make_pair(n - 4, m - 1)));
    V.push_back(make_pair(make_pair(n - 3, m - 2), make_pair(n - 3, m - 1)));
    V.push_back(make_pair(make_pair(n - 3, m - 1), make_pair(n - 2, m - 1)));
    switch (A[i]) {
      case 0: {
        V.push_back(make_pair(make_pair(n, m - 3), make_pair(n, m - 2)));
        V.push_back(
            make_pair(make_pair(n - 1, m - 3), make_pair(n - 1, m - 2)));
        V.push_back(make_pair(make_pair(n - 3, m), make_pair(n - 2, m)));
        break;
      }
      case 1: {
        V.push_back(make_pair(make_pair(n, m - 3), make_pair(n, m - 2)));
        V.push_back(
            make_pair(make_pair(n - 1, m - 3), make_pair(n - 1, m - 2)));
        break;
      }
      case 2: {
        V.push_back(
            make_pair(make_pair(n - 1, m - 3), make_pair(n - 1, m - 2)));
        break;
      }
      case 3: {
        V.push_back(make_pair(make_pair(n, m - 3), make_pair(n, m - 2)));
        V.push_back(make_pair(make_pair(n - 3, m), make_pair(n - 2, m)));
        break;
      }
      case 4: {
        V.push_back(make_pair(make_pair(n, m - 3), make_pair(n, m - 2)));
        break;
      }
      case 5: {
        break;
      }
    }
  }
  printf("%d %d\n", n, m);
  printf("%d\n", V.size());
  for (int i = 0; i < V.size(); i++) {
    printf("%d %d %d %d\n", V[i].first.first, V[i].first.second,
           V[i].second.first, V[i].second.second);
  }
}
