fn main() { let mut n = read::(); for j in 0..n { for i in 0..n { print!("{} ", (i + j) % n + 1); } println!(""); } } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() }