main=do n<-readLn;mapM putStrLn[unwords[show$abs(x-y)+1|x<-[1..n]]|y<-[1..n]]