integer a,b,c,d,x,y,z
do 10 a=1,9
do 10 b=0,9
do 10 c=1,9
do 10 d=0,9
x=a*1000+b*100+c*10+d
y=c*100+d*10+c
z=a*100+b*10+c
if (x-y.eq.z) then
write(*,*)'THE RESULT IS:'
write(*,*)' ',x
write(*,*)' -',y
write(*,*)'-----------------'
write(*,*)' ',z
endif
10 continue
end