main=interact(\a->unlines[shows n":"++unwords[show x|x<-[1..n],mod n x<1]|n<-[1..read a]])