fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n: u8 = s.trim().parse().unwrap(); for i in 0..n { println!( "{}", (0..n) .map(|j| ((i + j) % n + 1).to_string()) .collect::>() .join(" ") ) } }