// Author: Pavel Kuznetsov
//
// Simple backtracking
// Should work too long for N=30
//
#include <iostream>
#include <map>
#include <stdio.h>
#include <vector>

using namespace std;

#define For(i,a,b) for(int i=(int)(a);i<=(int)(b);++i)

const int MAXN = 40;

int n, can[MAXN+1], mate[MAXN+1];
long long res;

void solve(int need){
	if (need == 0) {
		++res;
		return;
	}
	
	For(i,1,n) if (can[i]) {
		if (i-need > 0 && i-need <= n && mate[i] != i-need && can[i-need]) {
			--can[i]; --can[i-need];
			int m1 = mate[i], m2 = mate[i-need];
			mate[m1] = m2; mate[m2] = m1;
			solve(need-1);
			++can[i]; ++can[i-need];
			mate[m1]=i; mate[m2]=i-need;
		}
	}
}

int main(){

	freopen("output.txt","wt",stdout);
	
	printf("1 1\n");
	
	For(j,2,20) {
	  n=j;
	  res = 0;
	  For(i,1,n) can[i] = 2, mate[i] = i;
	  solve(n-1);
	
	  cout << j << ' ' << 2*res<<endl;
  }
	
	return 0;
}
