For a:=1 to 9 do
For b:=0 to 9 do
For c:=0 to 9 do
For d:=1 to 9 do
For e:=1 to 9 do
If ((a*1000+b*100+c*10+d)*e = d*1000+c*100+b*10+a) and (a<>b) and (a<>c) and
(a<>d) and (a<>e) and (b<>c) and (b<>d) and (b<>e) and (c<>d) and (c<>e) and
(d<>e) then Writeln('a=',a,' b=',b,' c=',c,' d=',d,' e=',e);