#include <bits/stdc++.h>
using namespace std;
static const int INF = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
template <typename T, typename U>
static void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static void amax(T &x, U y) {
  if (x < y) x = y;
}
pair<pair<int, int>, pair<int, int>> transposed(
    pair<pair<int, int>, pair<int, int>> a) {
  pair<int, int> p = a.first, q = a.second;
  return {{p.second, p.first}, {q.second, q.first}};
}
int main() {
  long long D;
  while (~scanf("%lld", &D)) {
    vector<pair<pair<int, int>, pair<int, int>>> ans;
    long long x = D;
    for (int(i) = 0; (i) < (int)(38); ++(i)) {
      if (x % 3 <= 1) ans.push_back({{i + 1, 3 + i}, {i + 1, 3 + i + 1}});
      if (x % 3 == 0) ans.push_back({{3 + i, i + 1}, {3 + i + 1, i + 1}});
      if (i < 36) {
        ans.push_back({{i + 1, 3 + i + 2}, {i + 1, 3 + i + 3}});
        ans.push_back(transposed(ans.back()));
      }
      if (i < 37) {
        ans.push_back({{i + 1, 3 + i + 1}, {i + 2, 3 + i + 1}});
        ans.push_back(transposed(ans.back()));
      } else {
        ans.push_back({{i + 2, 3 + i}, {i + 2, 3 + i + 1}});
        ans.push_back(transposed(ans.back()));
        ans.push_back({{i + 3, 3 + i}, {i + 3, 3 + i + 1}});
        ans.push_back(transposed(ans.back()));
      }
      x /= 3;
    }
    puts("41 41");
    printf("%d\n", (int)ans.size());
    for (auto w : ans) {
      auto p = w.first, q = w.second;
      printf("%d %d %d %d\n", p.first, p.second, q.first, q.second);
    }
  }
  return 0;
}
