import java.util.*;
import java.io.*;
class tocka{
	int x,y;

	public tocka(int x,int y){
		this.x=x;
		this.y=y;
	}
	public tocka mult(int a) {
		return new tocka(x*a,y*a);
	}
	@Override public int hashCode(){
		return Objects.hash(x,y);
	}
	@Override public boolean equals(Object obj){
		if(this==obj)
			return true;
		if(obj==null)
			return false;
		if(getClass()!=obj.getClass())
			return false;
		tocka other=(tocka)obj;
		return x==other.x&&y==other.y;
	}
	@Override public String toString(){
		return "("+x+", "+y+")";
	}
}

public class n3{
	static PrintWriter out;
	public static long[] simRound(long[]q) {
		long[]q2=new long[q.length];
		for(int j=0;j<q.length;j++) {
			for(int t=j-1;t<=j+1;t++) {
				try {
					q2[j]+=q[t];
				}catch(Exception e) {};
			}
		}
		return q2;
	}
	public static double[] simRound(double[]q) {
		double[]q2=new double[q.length];
		for(int j=0;j<q.length;j++) {
			for(int t=j-1;t<=j+1;t++) {
				try {
					q2[j]+=q[t];
				}catch(Exception e) {};
			}
		}
		return q2;
	}
	public static void main(String args[]) throws Exception{
		out = new PrintWriter(System.out);
		Long l=I.readLong();
//		System.out.println(l);
		int cut=40*1000 + 1000;
		int days=38;
		out.println(cut);
		
		for(int row=0;row<1000;row++) {
			for(int col=0;col<40;col++) {
				int x=col;
				int y=2*row;
				int work=col==0?1:0;
				out.println(x+" "+y+" "+work);
			}
		}
		
		for(int empty=0;empty<1000; empty++) {
			int x=2*empty;
			int y=-2;
			out.println(x+" "+y+" 1");
		}
		long[]opcije = {7939655757745265l, 15005093288285684l, 20478701821859599l, 23917723163853540l, 25207579397552460l, 24542999771488802l, 22349560454849467l, 19172244815036416l, 15561970201337358l, 11985811929985460l, 8775232856383928l, 6113793350723272l, 4055790752745318l, 2562328679421672l, 1541459118352490l, 882655362672352l, 480759765245674l, 248860205872368l, 122287764072938l, 56965811111240l, 25115352874780l, 10459798179996l, 4105740068526l, 1514983334240l, 523899871075l, 169185885130l, 50808290184l, 14118959204l, 3609008675l, 842489260, 178027017, 33676512, 5621891, 812668, 99085, 9804, 740, 38, 1, 0};
		ArrayList<tocka> collect = new ArrayList<tocka>();
		for(int col=4;col<opcije.length-1;col++) {
			for(int row=0;row<1000;row++) {
				if(opcije[col]<=l) {
					int x=col;
					int y=2*row;
					collect.add(new tocka(x, y));
					l-=opcije[col];
				}else {
					break;
				}
			}
		}
//		out.println(collect);
		out.println(collect.size()+" "+days);
//		out.println(l);
		for(tocka t:collect) {
			out.println(t.x+" "+t.y);
		}
		out.close();
	}

}

class I3{
	static BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st;

	public static String nextToken() throws Exception{
		while(st==null||!st.hasMoreTokens()){
			st=new StringTokenizer(in.readLine(),"[ ,:]");
		}
		return st.nextToken();
	}

	public static int readInt() throws Exception{
		return Integer.parseInt(nextToken());
	}

	public static long readLong() throws Exception{
		return Long.parseLong(nextToken());
	}

	public static double readDouble() throws Exception{
		return Double.parseDouble(nextToken());
	}

	public static String readString() throws Exception{
		return nextToken();
	}

	public static String readLine() throws Exception{
		return in.readLine();
	}
}
