#include <bits/stdc++.h>
long long gi() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) f ^= ch == '-', ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f ? x : -x;
}
std::mt19937 rnd(time(NULL));
template <class T>
void cxk(T& a, T b) {
  a = a > b ? a : b;
}
template <class T>
void cnk(T& a, T b) {
  a = a < b ? a : b;
}
bool wad[55][55], war[55][55];
long long F[55][55];
int main() {
  long long T = gi();
  int n = 2, c = 14;
  for (long long X = 4 * c; X >= 0; X -= 4) {
    --n;
    wad[n + 3][n + 1] = wad[n + 3][n + 2] = wad[n + 4][n + 1] =
        wad[n + 4][n + 2] = 1;
    int k = (T >> X) & 15;
    wad[n][n + 2] = wad[n][n + 3] = wad[n][n + 4] = 1;
    war[n + 2][n] = war[n + 3][n] = war[n + 4][n] = 1;
    if (k >= 9) wad[n][n + 2] = 0, k -= 9;
    if (k >= 4) wad[n][n + 3] = 0, k -= 4;
    if (k >= 2) war[n + 3][n] = 0, k -= 2;
    if (k >= 1) wad[n][n + 4] = 0, k -= 1;
    if (k >= 1) war[n + 4][n] = 0, k -= 1;
    for (int i = n; i <= n + 2; ++i) wad[n + 5][i] = war[i][n + 5] = 1;
    for (int i = n + 1; i <= n + 3; ++i) war[i][n + 4] = wad[n + 4][i] = 1;
    n += 4;
  }
  wad[1][2] = 1;
  war[2][1] = 1;
  printf("%d %d\n", n, n);
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      ans += (i < n) * wad[i][j] + (j < n) * war[i][j];
  printf("%d\n", ans);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      if (i < n && wad[i][j]) printf("%d %d %d %d\n", i, j, i + 1, j);
      if (j < n && war[i][j]) printf("%d %d %d %d\n", i, j, i, j + 1);
    }
  F[1][1] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      if (!wad[i][j]) F[i + 1][j] += F[i][j];
      if (!war[i][j]) F[i][j + 1] += F[i][j];
    }
  if (F[n][n] != T) {
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        printf("%3d%c", F[i][j], war[i][j] ? '|' : ' ');
      }
      puts("");
      for (int j = 1; j <= n; ++j) {
        printf("%s ", wad[i][j] ? "---" : "   ");
      }
      puts("");
    }
  }
  return 0;
}
