import List g[]="" g(x:y)=intersperse ' 'x++"\n"++g y a="012345" main=putStr$g[z|p<-a,q<-a,r<-a,s<-a,t<-a,u<-a,let z=[p,q,r,s,t,u],a==sort z]