#include <bits/stdc++.h>
using namespace std;
bool ban[55][55][2];
int main() {
  long long t;
  scanf("%lld", &t);
  int n = 2, m = 2;
  ban[2][1][0] = ban[1][2][1] = 1;
  static int bit[40];
  int co = 0;
  for (; t; t /= 6) bit[++co] = t % 6;
  for (; co; co--) {
    int nd = bit[co] % 6;
    n += 2, m += 2;
    ban[n][m - 4][0] = 1;
    ban[n][m - 2][1] = ban[n][m - 1][1] = 1;
    ban[n - 1][m][0] = ban[n - 2][m][0] = 1;
    ban[n - 3][m - 1][1] = 1;
    ban[n - 4][m][1] = 1;
    if (nd < 3) ban[n - 1][m - 3][0] = 1;
    if ((nd % 3) < 2) ban[n][m - 3][0] = 1;
    if (nd % 3 == 0) ban[n - 3][m][1] = 1;
    if (co > 1)
      ban[n + 1][m - 4][0] = 1, ban[n - 4][m + 1][1] = 1,
                     ban[n - 2][m + 2][1] = 1, ban[n + 2][m - 2][0] = 1;
  }
  static int lis[1000][4];
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (i < n && ban[i][j][1])
        lis[++cnt][0] = i, lis[cnt][1] = j, lis[cnt][2] = 1, lis[cnt][3] = 0;
      if (j < m && ban[i][j][0])
        lis[++cnt][0] = i, lis[cnt][1] = j, lis[cnt][2] = 0, lis[cnt][3] = 1;
    }
  printf("%d %d\n", n, m);
  printf("%d\n", cnt);
  for (int i = 1; i <= cnt; i++)
    printf("%d %d %d %d\n", lis[i][0], lis[i][1], lis[i][0] + lis[i][2],
           lis[i][1] + lis[i][3]);
  return 0;
}
