#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int a[21][21],ans,c,h,w;
void dfs(int x,int y);
bool ch(int x,int y){
  return !(a[y][x-1]!=a[y-1][x-1]&&a[y-1][x]!=a[y-1][x-1]&&a[y][x-1]!=a[y-1][x]);
}
void in(int x,int y){
  if(x==w-1)dfs(0,y+1);
  else dfs(x+1,y);
}
void dfs(int x,int y){
  if(x==w-1&&y==h-1)ans++;
  else{
    if(a[y][x])in(x,y);
    else if(!x||!y||(ch(x,y))){
      int col=++c;
      a[y][x]=col;
      if(y!=h-1&&!a[y+1][x]){
        a[y+1][x]=col;
        in(x,y);
        a[y+1][x]=0;
      }
      if(x!=w-1&&!a[y][x+1]){
        a[y][x+1]=col;
        in(x,y);
        a[y][x+1]=0;
      }
      a[y][x]=0;
    }
  }
}
int main(){
  while(cin>>h>>w,h){
    memset(a,0,sizeof(a));
    ans=c=0;
    if(h%2==0||w%2==0)dfs(0,0);
    cout<<ans<<endl;
  }
}
### Prompt

In Cpp, your task is to solve 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 <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int a[21][21],ans,c,h,w;
void dfs(int x,int y);
bool ch(int x,int y){
  return !(a[y][x-1]!=a[y-1][x-1]&&a[y-1][x]!=a[y-1][x-1]&&a[y][x-1]!=a[y-1][x]);
}
void in(int x,int y){
  if(x==w-1)dfs(0,y+1);
  else dfs(x+1,y);
}
void dfs(int x,int y){
  if(x==w-1&&y==h-1)ans++;
  else{
    if(a[y][x])in(x,y);
    else if(!x||!y||(ch(x,y))){
      int col=++c;
      a[y][x]=col;
      if(y!=h-1&&!a[y+1][x]){
        a[y+1][x]=col;
        in(x,y);
        a[y+1][x]=0;
      }
      if(x!=w-1&&!a[y][x+1]){
        a[y][x+1]=col;
        in(x,y);
        a[y][x+1]=0;
      }
      a[y][x]=0;
    }
  }
}
int main(){
  while(cin>>h>>w,h){
    memset(a,0,sizeof(a));
    ans=c=0;
    if(h%2==0||w%2==0)dfs(0,0);
    cout<<ans<<endl;
  }
}
```