Problem:
Score : 900 points

Problem Statement

We have a grid with (2^N - 1) rows and (2^M-1) columns.
You are asked to write 0 or 1 in each of these squares.
Let a_{i,j} be the number written in the square at the i-th row from the top and the j-th column from the left.

For a quadruple of integers (i_1, i_2, j_1, j_2) such that 1\leq i_1 \leq i_2\leq 2^N-1, 1\leq j_1 \leq j_2\leq 2^M-1, let
S(i_1, i_2, j_1, j_2) = \displaystyle \sum_{r=i_1}^{i_2}\sum_{c=j_1}^{j_2}a_{r,c}.
Then, let the oddness of the grid be the number of quadruples (i_1, i_2, j_1, j_2) such that S(i_1, i_2, j_1, j_2) is odd.

Find a way to fill in the grid that maximizes its oddness.

Constraints

N and M are integers between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N M

Output

Print numbers to write in the grid so that its oddness is maximized, in the following format:

a_{1,1}a_{1,2}\cdots a_{1,2^M-1}
a_{2,1}a_{2,2}\cdots a_{2,2^M-1}
\vdots
a_{2^N-1,1}a_{2^N-1,2}\cdots a_{2^N-1,2^M-1}

If there are multiple solutions, you can print any of them.

Sample Input 1

1 2

Sample Output 1

111

For this grid, S(1, 1, 1, 1), S(1, 1, 2, 2), S(1, 1, 3, 3), and S(1, 1, 1, 3) are odd, so it has the oddness of 4.

We cannot make the oddness 5 or higher, so this is one of the ways that maximize the oddness.

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
char an[1024][1024];
char tmp[1024][1024];
int N,M;
int ma;
void print(){
    FOR(i,1,N)FOR(j,1,M){
        if(an[i][j]^an[i-1][j]^an[i][j-1]^an[i-1][j-1])putchar('1');
        else putchar('0');
        if(j==M)puts("");
    }
}
void dfs(int x,int y){
    if(x>N){
        int cnt=0;
        FOR(i,0,N)FOR(i2,i+1,N){
            FOR(j,0,M)FOR(j2,j+1,M){
                if(tmp[i][j]^tmp[i][j2]^tmp[i2][j]^tmp[i2][j2]){
                    cnt++;
                }
            }
        }
        if(cnt>=ma){
            if(cnt==24){
                W("-----");
                print();
            }
            ma=cnt;
            FOR(i,1,N)FOR(j,1,M)an[i][j]=tmp[i][j];
        }
        return;
    }
    if(y==4){
        dfs(x+1,1);
        return;
    }
    tmp[x][y]=1;
    dfs(x,y+1);
    tmp[x][y]=0;
    dfs(x,y+1);
}
int main(){
    R(N,M);
    if(N==1||M==1){
        REP(i,(1<<N)-1)W(string((1<<M)-1,'1'));
    }
    else {
        N=(1<<N)-1;
        M=(1<<M)-1;
        REP(i,N)REP(j,M){
            putchar('0'+(i+j)%2);
            if(j==M-1)puts("");
        }
        return 0;
        dfs(1,1);
        FOR(i,1,N)FOR(j,1,M){
            if(i>=4)an[i][j]=an[i-4][j];
            else if(j>=4)an[i][j]=an[i][j-4];
        }
        print();
    }
    return 0;
}