main=interact$ \s->[746,13875,16188]!!read[s!!1]?[0..29];n?(i:l)|j<-i+6^mod n 2=shows i","++shows j" "++div n 2?filter(/=j)l;_?_=""