#include <bits/stdc++.h>
using namespace std;
struct edge {
  int i, j, type;
  bool operator<(edge e) const { return 0; }
};
const int N = 34;
vector<edge> e;
int u[N][N];
long long d1[N + 1][N + 1];
long long d2[N + 1][N + 1];
void f() {
  memset(d1, 0, sizeof(d1));
  d1[0][0] = 1;
  for (int i = 0; i < (int)(N); i++)
    for (int j = 0; j < (int)(N); j++) {
      if (i + 1 < N && !(int)(((u[i][j]) >> (0)) & 1)) d1[i + 1][j] += d1[i][j];
      if (j + 1 < N && !(int)(((u[i][j]) >> (1)) & 1)) d1[i][j + 1] += d1[i][j];
    }
  memset(d2, 0, sizeof(d2));
  d2[N - 1][N - 1] = 1;
  for (int i = (int)(N)-1; i >= 0; i--)
    for (int j = (int)(N)-1; j >= 0; j--) {
      if (i - 1 >= 0 && !(int)(((u[i - 1][j]) >> (0)) & 1))
        d2[i - 1][j] += d2[i][j];
      if (j - 1 >= 0 && !(int)(((u[i][j - 1]) >> (1)) & 1))
        d2[i][j - 1] += d2[i][j];
    }
}
int walls;
void result() {
  printf("%d %d\n%d\n", N, N, walls);
  for (int i = 0; i < (int)(N); i++)
    for (int j = 0; j < (int)(N); j++) {
      if ((int)(((u[i][j]) >> (0)) & 1))
        printf("%d %d %d %d\n", i + 1, j + 1, i + 2, j + 1);
      if ((int)(((u[i][j]) >> (1)) & 1))
        printf("%d %d %d %d\n", i + 1, j + 1, i + 1, j + 2);
    }
  exit(0);
}
int main() {
  long long T;
  cin >> T;
  for (int i = 0; i < (int)(N); i++)
    for (int j = 0; j < (int)(N); j++) {
      if (i + 1 < N) e.push_back(edge{i, j, 0});
      if (j + 1 < N) e.push_back(edge{i, j, 1});
    }
  for (int cnt = 0;; cnt++) {
    vector<edge> tmp = e;
    vector<pair<long long, edge>> a;
    memset(u, 0, sizeof(u)), walls = 0;
    while (1) {
      f();
      a.clear();
      for (auto p : tmp) {
        int di = !p.type, dj = p.type;
        long long x = d2[0][0] - d1[p.i][p.j] * d2[p.i + di][p.j + dj];
        if (x == T) {
          u[p.i][p.j] ^= 1 << p.type, walls++;
          result();
        }
        if (x > T) a.push_back(make_pair(x, p));
      }
      if (!(int)(a).size()) break;
      sort((a).begin(), (a).end());
      int k = rand() % min((int)(a).size(), ((cnt % 3) * 2 + 3));
      edge p = a[k].second;
      u[p.i][p.j] ^= 1 << p.type, walls++;
      swap(a[k], a.back()), a.pop_back();
      tmp.resize((int)(a).size());
      for (int i = 0; i < (int)((int)(a).size()); i++) tmp[i] = a[i].second;
      f();
      assert(d2[0][0] >= T);
    }
    f();
  }
}
