fn main() { let mut hw = String::new(); std::io::stdin().read_line(&mut hw).ok(); let hw: Vec = hw.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let h = hw[0]; let w = hw[1]; if h % 2 + w % 2 == 0 { for i in 0..h { println!("{}", vec!["1"; w].join(" ")); } } else if h % 2 + w % 2 == 1 { if h % 2 == 1 { for _ in 0..h-1 { println!("{}", vec!["1"; w].join(" ")); } println!("{}", vec!["0"; w].join(" ")); } else { let mut base = vec!["1"; w]; base[w-1] = "0"; for _ in 0..h { println!("{}", base.join(" ")); } } } else { let mut result = vec![vec!["1"; w]; h]; for i in 0..h.min(w) { result[i][i] = "0"; } if h > w { for i in (w..h).step_by(2) { result[i][(i-w)/2%w] = "0"; result[i+1][(i-w)/2%w] = "0"; } } else { for i in (h..w).step_by(2) { result[(i-h)/2%h][i] = "0"; result[(i-h)/2%h][i+1] = "0"; } } for i in 0..h { println!("{}", result[i].join(" ")); } } }