#include<iostream>
using namespace std;
struct State { int x[20][20]; };
int H, W;
int solve(State S, int cx, int cy, int depth) {
	if (cx == 30)return 1;
	int cnt = 0;
	//------------Yoko ni oku-------------
	if (cy < W - 1) {
		bool flag = true;
		if (cx >= 1 && cy >= 1 && S.x[cx][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx][cy - 1])flag = false;
		if (cx >= 1 && cy <= W - 3 && S.x[cx][cy + 2] != S.x[cx - 1][cy + 1] && S.x[cx - 1][cy + 2] != S.x[cx - 1][cy + 1] && S.x[cx - 1][cy + 2] != S.x[cx][cy + 2])flag = false;
		if (cy == W - 1 || S.x[cx][cy + 1] >= 1)flag = false;
		if (flag == true) {
			State T = S; T.x[cx][cy] = depth; T.x[cx][cy + 1] = depth;
			int dx = cx, dy = cy;
			while (T.x[dx][dy] >= 1) {
				dy++; if (dy == W) { dy = 0; dx++; }
				if (dx == H) { dx = 30; break; }
			}
			cnt += solve(T, dx, dy, depth + 1);
		}
	}
	//------------Tate ni oku--------------
	if (cx < H - 1) {
		bool flag = true;
		if (cx >= 1 && cy >= 1 && S.x[cx][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx][cy - 1])flag = false;
		if (cx >= 1 && cy <= W - 2 && S.x[cx][cy + 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy + 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy + 1] != S.x[cx][cy + 1])flag = false;
		if (cx == H - 1 || S.x[cx + 1][cy] >= 1)flag = false;
		if (flag == true) {
			State T = S; T.x[cx][cy] = depth; T.x[cx + 1][cy] = depth;
			int dx = cx, dy = cy;
			while (T.x[dx][dy] >= 1) {
				dy++; if (dy == W) { dy = 0; dx++; }
				if (dx == H) { dx = 30; break; }
			}
			cnt += solve(T, dx, dy, depth + 1);
		}
	}
	return cnt;
}
int main() {
	while (true) {
		cin >> H >> W; if (H == 0 && W == 0)break;
		State r; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++)r.x[i][j] = 0; }
		int ans = solve(r, 0, 0, 1);
		cout << ans << endl;
	}
	return 0;
}
### Prompt

Your task is to create 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<iostream>
using namespace std;
struct State { int x[20][20]; };
int H, W;
int solve(State S, int cx, int cy, int depth) {
	if (cx == 30)return 1;
	int cnt = 0;
	//------------Yoko ni oku-------------
	if (cy < W - 1) {
		bool flag = true;
		if (cx >= 1 && cy >= 1 && S.x[cx][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx][cy - 1])flag = false;
		if (cx >= 1 && cy <= W - 3 && S.x[cx][cy + 2] != S.x[cx - 1][cy + 1] && S.x[cx - 1][cy + 2] != S.x[cx - 1][cy + 1] && S.x[cx - 1][cy + 2] != S.x[cx][cy + 2])flag = false;
		if (cy == W - 1 || S.x[cx][cy + 1] >= 1)flag = false;
		if (flag == true) {
			State T = S; T.x[cx][cy] = depth; T.x[cx][cy + 1] = depth;
			int dx = cx, dy = cy;
			while (T.x[dx][dy] >= 1) {
				dy++; if (dy == W) { dy = 0; dx++; }
				if (dx == H) { dx = 30; break; }
			}
			cnt += solve(T, dx, dy, depth + 1);
		}
	}
	//------------Tate ni oku--------------
	if (cx < H - 1) {
		bool flag = true;
		if (cx >= 1 && cy >= 1 && S.x[cx][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy - 1] != S.x[cx][cy - 1])flag = false;
		if (cx >= 1 && cy <= W - 2 && S.x[cx][cy + 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy + 1] != S.x[cx - 1][cy] && S.x[cx - 1][cy + 1] != S.x[cx][cy + 1])flag = false;
		if (cx == H - 1 || S.x[cx + 1][cy] >= 1)flag = false;
		if (flag == true) {
			State T = S; T.x[cx][cy] = depth; T.x[cx + 1][cy] = depth;
			int dx = cx, dy = cy;
			while (T.x[dx][dy] >= 1) {
				dy++; if (dy == W) { dy = 0; dx++; }
				if (dx == H) { dx = 30; break; }
			}
			cnt += solve(T, dx, dy, depth + 1);
		}
	}
	return cnt;
}
int main() {
	while (true) {
		cin >> H >> W; if (H == 0 && W == 0)break;
		State r; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++)r.x[i][j] = 0; }
		int ans = solve(r, 0, 0, 1);
		cout << ans << endl;
	}
	return 0;
}
```