#include <bits/stdc++.h>
using namespace std;
const long long infLL = 1e18;
const long long evil = 62233;
vector<pair<pair<int, int>, pair<int, int>>> r;
int bl_sz = 24;
void out(pair<int, int> t) { cout << t.first << ' ' << t.second; }
int main() {
  long long z;
  cin >> z;
  r.push_back({{1, 4}, {1, 5}});
  r.push_back({{4, 1}, {5, 1}});
  for (int i = 1; i < bl_sz - 1; i++) {
    int t = 2 * i;
    r.push_back({{t, 4 + t}, {t, 5 + t}});
    r.push_back({{4 + t, t}, {5 + t, t}});
    r.push_back({{t + 1, 4 + t}, {t + 1, 5 + t}});
    r.push_back({{t + 4, 1 + t}, {t + 5, 1 + t}});
  }
  for (int i = 0; i < bl_sz; i++) {
    int q = z % 6;
    z /= 6;
    int t = 2 * i;
    if (i) {
      r.push_back({{0 + t, 2 + t}, {1 + t, 2 + t}});
      r.push_back({{2 + t, 0 + t}, {2 + t, 1 + t}});
      r.push_back({{0 + t, 3 + t}, {1 + t, 3 + t}});
      r.push_back({{3 + t, 0 + t}, {3 + t, 1 + t}});
    }
    if (q >= 3) {
      q -= 3;
    } else
      r.push_back({{3 + t, 2 + t}, {4 + t, 2 + t}});
    r.push_back({{2 + t, 3 + t}, {2 + t, 4 + t}});
    if (q) {
      q--;
    } else
      r.push_back({{3 + t, 1 + t}, {4 + t, 1 + t}});
    if (q) {
      q--;
    } else
      r.push_back({{1 + t, 3 + t}, {1 + t, 4 + t}});
  }
  int t = 2 * bl_sz + 1;
  r.push_back({{t, t}, {t, t + 1}});
  r.push_back({{t, t}, {t + 1, t}});
  cout << t + 1 << ' ' << t + 1 << endl;
  cout << r.size() << endl;
  for (int i = 0; i < r.size(); i++) {
    out(r[i].first);
    cout << ' ';
    out(r[i].second);
    cout << "\n";
  }
  return 0;
}
