#include<iostream>
using namespace std;

const int MAX = 20;
int data[MAX][MAX];
int H,W;
/*
void display(){
  for(int i = 0 ; i < H ; i++){
    for(int j = 0 ; j < W ; j++){
      cout << data[i][j];
    }
    cout << endl;
  }
  cout << endl;
}
*/
bool isCanSpread(int x,int y){
  if(x-1 < 0 || y-1 < 0)return true;
  if(data[y-1][x] == 2 && data[y-1][x-1] == 1)return true;
  if(data[y-1][x-1] == 1 && data[y][x-1] == 2)return true;
  return false;
}

void dfs(int x,int y,int& res){

  if(x == W){
    if(y == H-1){
      res++;
      //display();
    }
    else {
      dfs(0,y+1,res);
    }
    return;
  }
  if(data[y][x] != -1)dfs(x+1,y,res);
  else {
    if(!isCanSpread(x,y))return;

    data[y][x] = 1;

    // tate
    if(y+1 < H){
      data[y+1][x] = 2;
      dfs(x+1,y,res);
      data[y+1][x] = -1;    
    }

    // yoko
    if(x+1 < W){
      if(data[y][x+1] == -1){
        data[y][x+1] = 2;
        dfs(x+1,y,res);
        data[y][x+1] = -1;
      }
    }
    
    data[y][x] = -1;
  }
}

void solve(){
  for(int i = 0 ; i < MAX ; i++){
    for(int j = 0 ; j < MAX ; j++){
      data[i][j] = -1;
    }                                 
  }
  int res = 0;
  dfs(0,0,res);
  cout << res << endl;
}

int main(){
  while(cin >> H >> W,H || W)solve();
  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;

const int MAX = 20;
int data[MAX][MAX];
int H,W;
/*
void display(){
  for(int i = 0 ; i < H ; i++){
    for(int j = 0 ; j < W ; j++){
      cout << data[i][j];
    }
    cout << endl;
  }
  cout << endl;
}
*/
bool isCanSpread(int x,int y){
  if(x-1 < 0 || y-1 < 0)return true;
  if(data[y-1][x] == 2 && data[y-1][x-1] == 1)return true;
  if(data[y-1][x-1] == 1 && data[y][x-1] == 2)return true;
  return false;
}

void dfs(int x,int y,int& res){

  if(x == W){
    if(y == H-1){
      res++;
      //display();
    }
    else {
      dfs(0,y+1,res);
    }
    return;
  }
  if(data[y][x] != -1)dfs(x+1,y,res);
  else {
    if(!isCanSpread(x,y))return;

    data[y][x] = 1;

    // tate
    if(y+1 < H){
      data[y+1][x] = 2;
      dfs(x+1,y,res);
      data[y+1][x] = -1;    
    }

    // yoko
    if(x+1 < W){
      if(data[y][x+1] == -1){
        data[y][x+1] = 2;
        dfs(x+1,y,res);
        data[y][x+1] = -1;
      }
    }
    
    data[y][x] = -1;
  }
}

void solve(){
  for(int i = 0 ; i < MAX ; i++){
    for(int j = 0 ; j < MAX ; j++){
      data[i][j] = -1;
    }                                 
  }
  int res = 0;
  dfs(0,0,res);
  cout << res << endl;
}

int main(){
  while(cin >> H >> W,H || W)solve();
  return 0;
}
```