main=interact f a%b|ab=reverse[b..a]|0<1=[a,b] f(a:b:s)=init(a%b)++f(b:s) f a=a