#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<utility>
#include<map>
#include<complex>
#include<stack>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define stop char nyaa;cin>>nyaa;
#define per(i,n) for(int i=n-1;i>=0;i--)
typedef long double ld;

int h, w;
int a[20][20];
int ans;
void dfs(int i, int j,int cur) {
	if (i == h) {
		/*cout << endl;
		rep(i, h) {
			rep(j, w) {
				cout << a[i][j];
			}
			cout << endl;
		}*/
		ans++; return;
	}
	int ni = i, nj = j + 1; if (nj == w)ni = ni + 1, nj = 0;
	if (a[i][j]) {
		dfs(ni, nj, cur); return;
	}
	//oo
	if (j < w - 1&&!a[i][j+1]) {
		a[i][j] = a[i][j + 1] = cur;
		bool f = true;
		if (j < w - 2&&i>0) {
			vector<int> v = { a[i - 1][j + 1],a[i][j + 1],a[i - 1][j + 2],a[i][j + 2] };
			sort(v.begin(), v.end());
			int len = unique(v.begin(), v.end()) - v.begin();
			if (len == 4)f = false;
		}
		if (f) {
			dfs(ni, nj, cur + 1);
		}
		a[i][j] = a[i][j + 1] = 0;
	}
	//else
	if (i < h - 1 && !a[i + 1][j]) {
		a[i][j] = a[i + 1][j] = cur;
		bool f = true;
		if (j < w - 1 && i>0) {
			vector<int> v = { a[i][j],a[i - 1][j],a[i][j + 1],a[i - 1][j + 1] };
			sort(v.begin(), v.end());
			int len = unique(v.begin(), v.end()) - v.begin();
			if (len == 4)f = false;
		}
		if (f) {
			dfs(ni, nj, cur + 1);
		}
		a[i][j] = a[i + 1][j] = 0;
	}
}
void solve() {
	ans = 0;
	dfs(0, 0, 1);
	cout << ans << endl;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	while (cin >> h >> w, h) {
		solve();
	}
	//stop
		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>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<utility>
#include<map>
#include<complex>
#include<stack>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define stop char nyaa;cin>>nyaa;
#define per(i,n) for(int i=n-1;i>=0;i--)
typedef long double ld;

int h, w;
int a[20][20];
int ans;
void dfs(int i, int j,int cur) {
	if (i == h) {
		/*cout << endl;
		rep(i, h) {
			rep(j, w) {
				cout << a[i][j];
			}
			cout << endl;
		}*/
		ans++; return;
	}
	int ni = i, nj = j + 1; if (nj == w)ni = ni + 1, nj = 0;
	if (a[i][j]) {
		dfs(ni, nj, cur); return;
	}
	//oo
	if (j < w - 1&&!a[i][j+1]) {
		a[i][j] = a[i][j + 1] = cur;
		bool f = true;
		if (j < w - 2&&i>0) {
			vector<int> v = { a[i - 1][j + 1],a[i][j + 1],a[i - 1][j + 2],a[i][j + 2] };
			sort(v.begin(), v.end());
			int len = unique(v.begin(), v.end()) - v.begin();
			if (len == 4)f = false;
		}
		if (f) {
			dfs(ni, nj, cur + 1);
		}
		a[i][j] = a[i][j + 1] = 0;
	}
	//else
	if (i < h - 1 && !a[i + 1][j]) {
		a[i][j] = a[i + 1][j] = cur;
		bool f = true;
		if (j < w - 1 && i>0) {
			vector<int> v = { a[i][j],a[i - 1][j],a[i][j + 1],a[i - 1][j + 1] };
			sort(v.begin(), v.end());
			int len = unique(v.begin(), v.end()) - v.begin();
			if (len == 4)f = false;
		}
		if (f) {
			dfs(ni, nj, cur + 1);
		}
		a[i][j] = a[i + 1][j] = 0;
	}
}
void solve() {
	ans = 0;
	dfs(0, 0, 1);
	cout << ans << endl;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	while (cin >> h >> w, h) {
		solve();
	}
	//stop
		return 0;
}


```