#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int h,w;
int ba[20][20];

// horizontal -> 1:2
// vartically -> 3
//               4
int solve(int x, int y) {
//  cout << x << " "<< y << endl;
//  REP(i,h) {REP(j,w)cout<<ba[i][j];cout<<endl;}
  if (y==h) return 1;
  if (x==w) return solve(0,y+1);
  if (ba[y][x]) return solve(x+1,y);
  // 横置き
  int res = 0;
  if (x<w-1&&ba[y][x+1]==0) {
    if (x&&y &&
        (ba[y-1][x-1]==2 || ba[y-1][x-1]==4) &&
        (ba[y-1][x] == 1 || ba[y-1][x] == 4) &&
        (ba[y][x-1] == 2 || ba[y][x-1] == 3)); // cross
    else {
      ba[y][x] = 1;
      ba[y][x+1] = 2;
      res += solve(x+1,y);
      ba[y][x] = ba[y][x+1] = 0;
    }
  }
  if (y<h-1&&ba[y+1][x]==0) {
    if (x&&y &&
        (ba[y-1][x-1]==2 || ba[y-1][x-1]==4) &&
        (ba[y-1][x] == 1 || ba[y-1][x] == 4) &&
        (ba[y][x-1] == 2 || ba[y][x-1] == 3)); // cross
    else {
      ba[y][x] = 3;
      ba[y+1][x] = 4;
      res += solve(x+1,y);
      ba[y][x] = ba[y+1][x] = 0;
    }
  }
  return res;
}
int main() {                    
  
  while(cin >> h >> w,h||w) {
    cout << solve(0,0) << 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 <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

int h,w;
int ba[20][20];

// horizontal -> 1:2
// vartically -> 3
//               4
int solve(int x, int y) {
//  cout << x << " "<< y << endl;
//  REP(i,h) {REP(j,w)cout<<ba[i][j];cout<<endl;}
  if (y==h) return 1;
  if (x==w) return solve(0,y+1);
  if (ba[y][x]) return solve(x+1,y);
  // 横置き
  int res = 0;
  if (x<w-1&&ba[y][x+1]==0) {
    if (x&&y &&
        (ba[y-1][x-1]==2 || ba[y-1][x-1]==4) &&
        (ba[y-1][x] == 1 || ba[y-1][x] == 4) &&
        (ba[y][x-1] == 2 || ba[y][x-1] == 3)); // cross
    else {
      ba[y][x] = 1;
      ba[y][x+1] = 2;
      res += solve(x+1,y);
      ba[y][x] = ba[y][x+1] = 0;
    }
  }
  if (y<h-1&&ba[y+1][x]==0) {
    if (x&&y &&
        (ba[y-1][x-1]==2 || ba[y-1][x-1]==4) &&
        (ba[y-1][x] == 1 || ba[y-1][x] == 4) &&
        (ba[y][x-1] == 2 || ba[y][x-1] == 3)); // cross
    else {
      ba[y][x] = 3;
      ba[y+1][x] = 4;
      res += solve(x+1,y);
      ba[y][x] = ba[y+1][x] = 0;
    }
  }
  return res;
}
int main() {                    
  
  while(cin >> h >> w,h||w) {
    cout << solve(0,0) << endl;
  }
}
```