import Numeric g n i|i>=0&&i<=9=toEnum(fromEnum '0'+i)|1>0=toEnum(fromEnum 'A'+i-10) f x|length x==1=' ':x|1>0=x main=do n<-readLn;mapM putStrLn$map((' ':).unwords)[[f(showIntAtBase n(g n)(a*b)"")|a<-[1..n-1]]|b<-[1..n-1]]