l="123456" main=mapM putStrLn$foldr(%)[""]l a%b=[x:y|x<-l,y<-b,all(/=x)$a:y]