#include<cstdio>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int h,w;

int corner[21][21];
char tatami[20][20];

int dfs(int i,int j){
	if(i==h) return 1;
	if(j==w) return dfs(i+1,0);

	if(tatami[i][j]=='#') return dfs(i,j+1);

	int res=0;
	// 縦に置く
	if(i+1<h && tatami[i+1][j]=='.'){
		corner[ i ][ j ]++;
		corner[ i ][j+1]++;
		corner[i+2][ j ]++;
		corner[i+2][j+1]++;
		tatami[i][j]=tatami[i+1][j]='#';
		if(corner[i][j]<4 && corner[i][j+1]<4 && corner[i+2][j]<4 && corner[i+2][j+1]<4){
			res+=dfs(i,j+1);
		}
		tatami[i][j]=tatami[i+1][j]='.';
		corner[ i ][ j ]--;
		corner[ i ][j+1]--;
		corner[i+2][ j ]--;
		corner[i+2][j+1]--;
	}
	// 横に置く
	if(j+1<w && tatami[i][j+1]=='.'){
		corner[ i ][ j ]++;
		corner[ i ][j+2]++;
		corner[i+1][ j ]++;
		corner[i+1][j+2]++;
		tatami[i][j]=tatami[i][j+1]='#';
		if(corner[i][j]<4 && corner[i][j+2]<4 && corner[i+1][j]<4 && corner[i+1][j+2]<4){
			res+=dfs(i,j+1);
		}
		tatami[i][j]=tatami[i][j+1]='.';
		corner[ i ][ j ]--;
		corner[ i ][j+2]--;
		corner[i+1][ j ]--;
		corner[i+1][j+2]--;
	}
	return res;
}

int main(){
	for(;scanf("%d%d",&h,&w),h;){
		rep(i,h) rep(j,w) tatami[i][j]='.';
		printf("%d\n",dfs(0,0));
	}
	return 0;
}
### Prompt

Generate a Cpp solution to the following problem:

A tatami mat, a Japanese traditional floor cover, has a rectangular form with aspect ratio 1:2. When spreading tatami mats on a floor, it is prohibited to make a cross with the border of the tatami mats, because it is believed to bring bad luck.

Your task is to write a program that reports how many possible ways to spread tatami mats of the same size on a floor of given height and width.



Input

The input consists of multiple datasets. Each dataset cosists of a line which contains two integers H and W in this order, separated with a single space. H and W are the height and the width of the floor respectively. The length of the shorter edge of a tatami mat is regarded as a unit length.

You may assume 0 < H, W ≤ 20.

The last dataset is followed by a line containing two zeros. This line is not a part of any dataset and should not be processed.

Output

For each dataset, print the number of possible ways to spread tatami mats in one line.

Example

Input

3 4
4 4
0 0


Output

4
2

### Response

```cpp
#include<cstdio>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int h,w;

int corner[21][21];
char tatami[20][20];

int dfs(int i,int j){
	if(i==h) return 1;
	if(j==w) return dfs(i+1,0);

	if(tatami[i][j]=='#') return dfs(i,j+1);

	int res=0;
	// 縦に置く
	if(i+1<h && tatami[i+1][j]=='.'){
		corner[ i ][ j ]++;
		corner[ i ][j+1]++;
		corner[i+2][ j ]++;
		corner[i+2][j+1]++;
		tatami[i][j]=tatami[i+1][j]='#';
		if(corner[i][j]<4 && corner[i][j+1]<4 && corner[i+2][j]<4 && corner[i+2][j+1]<4){
			res+=dfs(i,j+1);
		}
		tatami[i][j]=tatami[i+1][j]='.';
		corner[ i ][ j ]--;
		corner[ i ][j+1]--;
		corner[i+2][ j ]--;
		corner[i+2][j+1]--;
	}
	// 横に置く
	if(j+1<w && tatami[i][j+1]=='.'){
		corner[ i ][ j ]++;
		corner[ i ][j+2]++;
		corner[i+1][ j ]++;
		corner[i+1][j+2]++;
		tatami[i][j]=tatami[i][j+1]='#';
		if(corner[i][j]<4 && corner[i][j+2]<4 && corner[i+1][j]<4 && corner[i+1][j+2]<4){
			res+=dfs(i,j+1);
		}
		tatami[i][j]=tatami[i][j+1]='.';
		corner[ i ][ j ]--;
		corner[ i ][j+2]--;
		corner[i+1][ j ]--;
		corner[i+1][j+2]--;
	}
	return res;
}

int main(){
	for(;scanf("%d%d",&h,&w),h;){
		rep(i,h) rep(j,w) tatami[i][j]='.';
		printf("%d\n",dfs(0,0));
	}
	return 0;
}
```