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 Rust (1.15.1) (judge verdict: Wrong Answer)

// This code is generated by [cargo-atcoder](https://github.com/tanakh/cargo-atcoder)
// Original source code:
/*
use competitive::prelude::*;

fn main() {
    input! {
        n: usize,
        m: usize,
    }

    if false {
        let h = n;
        let w = m;

        let mut ans = (0, 0);

        for b in power_bitset(h * w) {
            let mut odds = 0;
            for i1 in 0..h {
                for j1 in 0..w {
                    for i2 in i1 + 1..=h {
                        for j2 in j1 + 1..=w {
                            let mut sum = 0;
                            for i in i1..i2 {
                                for j in j1..j2 {
                                    sum += if b[i * w + j] { 1 } else { 0 };
                                }
                            }
                            if sum % 2 == 1 {
                                odds += 1;
                            }
                        }
                    }
                }
            }

            if ans.0 < odds {
                ans = (odds, b.0);
            }
        }

        dbg!(ans);

        for b in power_bitset(h * w) {
            let mut odds = 0;
            for i1 in 0..h {
                for j1 in 0..w {
                    for i2 in i1 + 1..=h {
                        for j2 in j1 + 1..=w {
                            let mut sum = 0;
                            for i in i1..i2 {
                                for j in j1..j2 {
                                    sum += if b[i * w + j] { 1 } else { 0 };
                                }
                            }
                            if sum % 2 == 1 {
                                odds += 1;
                            }
                        }
                    }
                }
            }

            if odds == ans.0 {
                for i in 0..h {
                    for j in 0..w {
                        print!("{}", if b[i * w + j] { '1' } else { '0' });
                    }
                    println!();
                }
                println!();
            }
        }
    }

    let h = (1 << n) - 1;
    let w = (1 << m) - 1;

    for i in 0..h {
        for j in 0..w {
            print!("{}", (i + j) % 2);
        }
        println!();
    }
}
*/

fn main() {
    let exe = "/tmp/binBEEA3C89";
    std::io::Write::write_all(&mut std::fs::File::create(exe).unwrap(), &decode(BIN)).unwrap();
    std::fs::set_permissions(exe, std::os::unix::fs::PermissionsExt::from_mode(0o755)).unwrap();
    std::process::exit(std::process::Command::new(exe).status().unwrap().code().unwrap())
}

fn decode(v: &str) -> Vec<u8> {
    let mut ret = vec![];
    let mut buf = 0;
    let mut tbl = vec![64; 256];
    for i in 0..64 { tbl[TBL[i] as usize] = i as u8; }
    for (i, c) in v.bytes().filter_map(|c| { let c = tbl[c as usize]; if c < 64 { Some(c) } else { None } }).enumerate() {
        match i % 4 {
            0 => buf = c << 2,
            1 => { ret.push(buf | c >> 4); buf = c << 4; }
            2 => { ret.push(buf | c >> 2); buf = c << 6; }
            3 => ret.push(buf | c),
            _ => unreachable!(),
        }
    }
    ret
}

const TBL: &'static [u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const BIN: &'static str = "<base64-encoded ELF executable removed>";