#include <bits/stdc++.h>
using namespace std;
using LL = long long;
struct wall {
  int x, y, d;
  wall(int x = 0, int y = 0, int d = 0) : x(x), y(y), d(d) {}
  void bat() { printf("%d %d %d %d\n", x, y, x + d, y + 1 - d); }
};
int main() {
  LL n;
  cin >> n;
  vector<wall> ans;
  ans.push_back(wall(39, 39, 0));
  ans.push_back(wall(39, 39, 1));
  for (int i = 1; i < 40; i++) {
    if (i + 4 < 40) {
      ans.push_back(wall(i, i + 4, 0));
      ans.push_back(wall(i + 4, i, 1));
    }
    if (i + 3 < 40) {
      ans.push_back(wall(i, i + 3, 1));
      ans.push_back(wall(i + 3, i, 0));
    }
  }
  for (int i = 0; i < 37; i++) {
    if (n % 3 < 2) {
      ans.push_back(wall(i + 1, i + 3, 0));
    }
    if (n % 3 < 1) {
      ans.push_back(wall(i + 3, i + 1, 1));
    }
    n /= 3;
  }
  if (n < 2) ans.push_back(wall(38, 39, 0));
  if (n < 1) ans.push_back(wall(39, 38, 1));
  printf("%d %d\n", 40, 40);
  printf("%d\n", ans.size());
  for (auto i : ans) i.bat();
  return 0;
}
