main=mapM putStrLn[unwords[mapM(take b)[['0'..'9']++['a'..]|x<-[0..5],b^x<=n]!!n|b<-[2..n]]|n<-[2..]]