fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut grid = vec![vec![0usize; n]; n]; for i in 0..n { for j in i..n { if i == j { if i % 2 == 0 { grid[i][j] = 1; } else { grid[i][j] = 2; } } else { grid[i][j] = 2; } } } for i in 0..n { println!("{}", grid[i].iter().map(|&v| v.to_string()).collect::>().join("")); } }