#include <bits/stdc++.h>
using namespace std;
bool lf[51][51], dn[51][51];
long long T;
int i, j, tot;
int n;
int main() {
  cin >> T;
  for (i = 0; T; T /= 3, i++) {
    int x = T % 3;
    if (i) {
      tot += 2, dn[i][i + 3] = lf[i + 3][i] = 1;
      if (T >= 3) tot += 2, lf[i][i + 4] = dn[i + 4][i] = 1;
    }
    if (x < 2) tot++, lf[i + 1][i + 3] = 1;
    if (x < 1) tot++, dn[i + 3][i + 1] = 1;
  }
  lf[i + 1][i + 2] = lf[i + 2][i + 2] = 1;
  dn[i + 2][i + 1] = dn[i + 2][i + 2] = 1;
  n = i + 3;
  printf("%d %d\n", n, n);
  printf("%d\n", tot + 4);
  for (i = 1; i < n; i++)
    for (j = 1; j < n; j++) {
      if (lf[i][j]) printf("%d %d %d %d\n", i, j, i, j + 1);
      if (dn[i][j]) printf("%d %d %d %d\n", i, j, i + 1, j);
    }
  return 0;
}
