#include <bits/stdc++.h>
using namespace std;
vector<string> buffer;
int N = 4, M = 4;
void putBuffer(int x, int y, char d) {
  if (x <= 0 || y <= 0) {
    return;
  }
  int tx = x, ty = y;
  if (d == 'r') {
    ty++;
  } else {
    tx++;
  }
  if (tx > N || ty > M) {
    return;
  }
  stringstream ss;
  ss << x << " " << y << " " << tx << " " << ty;
  buffer.push_back(ss.str());
}
int main() {
  ios::sync_with_stdio(false);
  unsigned long long T;
  cin >> T;
  unsigned long long m = 6;
  while (m <= T) {
    m *= 6;
    N += 2;
    M += 2;
  }
  cout << N << " " << M << endl;
  m /= 6;
  putBuffer(1, 2, 'd');
  putBuffer(2, 1, 'r');
  int c = 2;
  while (m > 0) {
    putBuffer(c - 2, c + 2, 'd');
    putBuffer(c - 2, c + 3, 'd');
    putBuffer(c + 2, c - 2, 'r');
    putBuffer(c + 3, c - 2, 'r');
    putBuffer(c, c + 2, 'r');
    putBuffer(c + 1, c + 2, 'r');
    putBuffer(c + 2, c, 'd');
    putBuffer(c + 2, c + 1, 'd');
    putBuffer(c + 1, c - 1, 'r');
    int div = T / m;
    if (div >= 3) {
      div -= 3;
    } else {
      putBuffer(c - 1, c + 1, 'd');
    }
    if (div > 1) {
      div -= 1;
    } else {
      putBuffer(c + 2, c - 1, 'r');
    }
    if (div == 1) {
      div -= 1;
    } else {
      putBuffer(c - 1, c + 2, 'd');
    }
    c += 2;
    T %= m;
    m /= 6;
  }
  cout << buffer.size() << endl;
  for (const auto &s : buffer) {
    cout << s << endl;
  }
  cout << endl;
  return 0;
}
