#include <bits/stdc++.h>
using namespace std;
long long N;
int Dig[55];
struct Fence {
  int x1, y1, x2, y2;
} Sol[305];
int ind;
bool Closed[55];
void Solve() {
  int line = 1, col = 1, cnt = 0;
  long long init = N;
  while (init > 0) {
    Dig[++cnt] = init % 6;
    init /= 6;
  }
  line = 2, col = 2;
  Sol[++ind] = {1, 2, 2, 2};
  Sol[++ind] = {2, 1, 2, 2};
  for (int i = cnt; i >= 1; i--) {
    line += 2;
    col += 2;
    Sol[++ind] = {line - 3, col - 1, line - 2, col - 1};
    if (i > 1) {
      Sol[++ind] = {line - 1, col, line - 1, col + 1};
      Sol[++ind] = {line - 2, col, line - 2, col + 1};
    }
    if (line > 4 && i > 1) Sol[++ind] = {line - 4, col + 1, line - 3, col + 1};
    if (i > 1) Sol[++ind] = {line - 2, col + 2, line - 1, col + 2};
    if (i > 1) {
      Sol[++ind] = {line, col - 1, line + 1, col - 1};
      Sol[++ind] = {line, col - 2, line + 1, col - 2};
      if (col > 4) Sol[++ind] = {line + 1, col - 4, line + 1, col - 3};
      Sol[++ind] = {line + 2, col - 2, line + 2, col - 1};
    }
    int d = Dig[i];
    if (d < 3) Sol[++ind] = {line - 1, col - 3, line - 1, col - 2};
    if (d % 3 < 2) Sol[++ind] = {line, col - 3, line, col - 2};
    if (d % 3 == 0) Sol[++ind] = {line - 3, col, line - 2, col};
  }
  printf("%d %d\n", line, col);
  printf("%d\n", ind);
  for (int i = 1; i <= ind; i++) {
    printf("%d %d %d %d\n", Sol[i].x1, Sol[i].y1, Sol[i].x2, Sol[i].y2);
  }
}
int main() {
  cin >> N;
  Solve();
  return 0;
}
