#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <string.h>

using namespace std;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int board[44][44];
int h, w;

int DFS(int x, int y, int n){
	int ret = 0;
	while(board[x][y] != 0){
		x++;
		if(x > w){
			y++;
			x = 1;
			if(y > h)return 1;
		}
	}
	//たて向き
	if(board[x][y+1]==0){
		int check = 0;
		if(board[x][y-1] != board[x+1][y-1])check++;
		if(board[x+1][y-1] != board[x+1][y])check++;
		if(check != 2){
			board[x][y] = n;
			board[x][y+1] = n;
			ret += DFS(x,y,n+1);
			board[x][y] = 0;
			board[x][y+1] = 0;
		}
	}
	//よこ向き
	if(board[x+1][y]==0){
		int check = 0;
		if(board[x+1][y-1] != board[x+2][y-1])check++;
		if(board[x+2][y] != board[x+2][y-1])check++;
		if(check != 2){
			board[x][y] = n;
			board[x+1][y] = n;
			ret += DFS(x,y,n+1);
			board[x][y] = 0;
			board[x+1][y] = 0;
		}
	}
	return ret;
}

int main(){
	while(1){
		memset(board, 0, sizeof(board));
		cin >> h>> w;
		if(h==0)break;
		REP(i,w+2){
			board[i][0] = 1000;
			board[i][h+1] = 1000;
		}
		REP(i,h+2){
			board[0][i] = 1000;
			board[w+1][i] = 1000;
		}
		if(h==0)return 0;
		cout << DFS(1, 1, 1) << endl;
	}
}
### Prompt

Construct a Cpp code solution to the problem outlined:

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 <iostream>
#include <cstdio>
#include <stdio.h>
#include <string.h>

using namespace std;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int board[44][44];
int h, w;

int DFS(int x, int y, int n){
	int ret = 0;
	while(board[x][y] != 0){
		x++;
		if(x > w){
			y++;
			x = 1;
			if(y > h)return 1;
		}
	}
	//たて向き
	if(board[x][y+1]==0){
		int check = 0;
		if(board[x][y-1] != board[x+1][y-1])check++;
		if(board[x+1][y-1] != board[x+1][y])check++;
		if(check != 2){
			board[x][y] = n;
			board[x][y+1] = n;
			ret += DFS(x,y,n+1);
			board[x][y] = 0;
			board[x][y+1] = 0;
		}
	}
	//よこ向き
	if(board[x+1][y]==0){
		int check = 0;
		if(board[x+1][y-1] != board[x+2][y-1])check++;
		if(board[x+2][y] != board[x+2][y-1])check++;
		if(check != 2){
			board[x][y] = n;
			board[x+1][y] = n;
			ret += DFS(x,y,n+1);
			board[x][y] = 0;
			board[x+1][y] = 0;
		}
	}
	return ret;
}

int main(){
	while(1){
		memset(board, 0, sizeof(board));
		cin >> h>> w;
		if(h==0)break;
		REP(i,w+2){
			board[i][0] = 1000;
			board[i][h+1] = 1000;
		}
		REP(i,h+2){
			board[0][i] = 1000;
			board[w+1][i] = 1000;
		}
		if(h==0)return 0;
		cout << DFS(1, 1, 1) << endl;
	}
}
```