#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
vvi ta;
int n,m,out;
bool F(){
	bool h=true;
	rep(i,n-1)rep(j,m-1){
		int a=ta[i][j],b=ta[i+1][j],c=ta[i][j+1],d=ta[i+1][j+1];
		if(a*b*c*d==0)break;
		if(a==b||a==c||a==d||b==c||b==d||c==d);
		else h=false;
	}
	return h;
}
void f(int d,int a,int b){
	if(a==n){out+=F();return;}
	if(b==m){f(d,a+1,0);return;}
	
	if(ta[a][b]){f(d,a,b+1);return;}
	//tate
	if(a!=n-1&&ta[a+1][b]==0){
		ta[a][b]=ta[a+1][b]=d;
		if(F())f(d+1,a,b+1);
		ta[a][b]=ta[a+1][b]=0;
	}
	//yoko
	if(b!=m-1&&ta[a][b+1]==0){
		ta[a][b]=ta[a][b+1]=d;
		if(F())f(d+1,a,b+2);
		ta[a][b]=ta[a][b+1]=0;	
	}
}
int main(){
	while(cin>>n>>m,n+m){
		ta=vvi(n,vi(m));
		out=0;
		f(1,0,0);
		cout<<out<<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<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
vvi ta;
int n,m,out;
bool F(){
	bool h=true;
	rep(i,n-1)rep(j,m-1){
		int a=ta[i][j],b=ta[i+1][j],c=ta[i][j+1],d=ta[i+1][j+1];
		if(a*b*c*d==0)break;
		if(a==b||a==c||a==d||b==c||b==d||c==d);
		else h=false;
	}
	return h;
}
void f(int d,int a,int b){
	if(a==n){out+=F();return;}
	if(b==m){f(d,a+1,0);return;}
	
	if(ta[a][b]){f(d,a,b+1);return;}
	//tate
	if(a!=n-1&&ta[a+1][b]==0){
		ta[a][b]=ta[a+1][b]=d;
		if(F())f(d+1,a,b+1);
		ta[a][b]=ta[a+1][b]=0;
	}
	//yoko
	if(b!=m-1&&ta[a][b+1]==0){
		ta[a][b]=ta[a][b+1]=d;
		if(F())f(d+1,a,b+2);
		ta[a][b]=ta[a][b+1]=0;	
	}
}
int main(){
	while(cin>>n>>m,n+m){
		ta=vvi(n,vi(m));
		out=0;
		f(1,0,0);
		cout<<out<<endl;
	}
}
```