#include <bits/stdc++.h>
using namespace std;
long long int n, m, a, b, c, d;
char in[100], out[100];
long long int f(long long int x, long long int y){
	if(x<1 or x > n -(y+1)%2 or  y> d) return 0;
	if(x == c and y == d) return 1;
	return f(x-y%2,y+1)+f(x+1-y%2,y+1)+f(x+1,y);
}
int main(){
	for(int I=31;I<=40;I++){
		sprintf(in,".%d.in",I);
	    freopen(in,"w",stdout);
		n = I-20;
		m = I-20;
		a = 1;
		b = 1;
		c = n-(m%2);
		d = n;
		cout << n << " " << m<<endl;
		cout << a<<" "<< b<<" "<< c<<" "<< d<<endl;
		sprintf(out,".%d.out",I);
	    freopen(out,"w",stdout);
		long long int k = f(a,b);
		cout << k;
		if (k==0) I--;
	}
}
