n=gets.to_i for _ in 1..n for i in (0...n).map{|v| v}.reverse print i end end puts