#include <bits/stdc++.h>
using namespace std;
long long f[100][100];
long long g[100][100];
long long h[100][100];
long long r[100][100];
vector<pair<pair<int, int>, pair<int, int> > > K;
const long long INF = 4000000000000000001;
int main() {
  ios_base::sync_with_stdio(0);
  long long T;
  cin >> T;
  int n = 33, m = 33;
  cout << n << " " << m << endl;
  while (1) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        if (i == 1 && j == 1) {
          f[i][j] = 1;
        } else {
          f[i][j] = f[i - 1][j] * (1 - g[i][j]) + f[i][j - 1] * (1 - h[i][j]);
          if (f[i][j] > INF) {
            f[i][j] = INF;
          }
        }
      }
    }
    for (int i = n; i >= 1; i--) {
      for (int j = m; j >= 1; j--) {
        if (i == n && j == m) {
          r[i][j] = 1;
        } else {
          r[i][j] =
              r[i + 1][j] * (1 - g[i + 1][j]) + r[i][j + 1] * (1 - h[i][j + 1]);
          if (r[i][j] > INF) {
            r[i][j] = INF;
          }
        }
      }
    }
    long long ans = f[n][m];
    if (ans == T) {
      break;
    }
    int ii = 0, jj = 0, tp = 0, cnt = 0;
    long long mx = ans;
    vector<pair<long long, pair<pair<int, int>, int> > > Q;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        if (g[i + 1][j] == 0 && ans - f[i][j] * r[i + 1][j] >= T) {
          if (ans - f[i][j] * r[i + 1][j] < ans) {
            mx = ans - f[i][j] * r[i + 1][j];
            ii = i + 1;
            jj = j;
            tp = 1;
            Q.push_back(make_pair(mx, make_pair(make_pair(ii, jj), tp)));
          }
        }
        if (h[i][j + 1] == 0 && ans - f[i][j] * r[i][j + 1] >= T) {
          if (ans - f[i][j] * r[i][j + 1] < ans) {
            mx = ans - f[i][j] * r[i][j + 1];
            ii = i;
            jj = j + 1;
            tp = 2;
            Q.push_back(make_pair(mx, make_pair(make_pair(ii, jj), tp)));
          }
        }
      }
    }
    sort(Q.begin(), Q.end());
    if (Q.size() == 0) {
      while (K.size() > 0) {
        pair<pair<int, int>, pair<int, int> > lst = K[K.size() - 1];
        if (lst.first.first == lst.second.first) {
          h[lst.second.first][lst.second.second] = 0;
        } else {
          g[lst.second.first][lst.second.second] = 0;
        }
        K.pop_back();
      }
      continue;
    }
    int id = min((int)Q.size() - 1, rand() % 4);
    mx = Q[id].first;
    ii = Q[id].second.first.first;
    jj = Q[id].second.first.second;
    tp = Q[id].second.second;
    if (tp == 1) {
      K.push_back(make_pair(make_pair(ii - 1, jj), make_pair(ii, jj)));
      g[ii][jj] = 1;
    } else {
      K.push_back(make_pair(make_pair(ii, jj - 1), make_pair(ii, jj)));
      h[ii][jj] = 1;
    }
  }
  cout << K.size() << endl;
  for (int i = 0; i < K.size(); i++) {
    cout << K[i].first.first << " " << K[i].first.second << " "
         << K[i].second.first << " " << K[i].second.second << endl;
  }
  return 0;
}
