main=mapM print$f 3 f 0=[] f k=[j*10+i|j<-[1..9]++f(k-1),i<-[0..9],abs(i-j`mod`10)>5]