var i:integer; Begin For i:=1000 to 9999 do if (i div 1000 + i mod 10)=(i div 100 mod 10 + i div 10 mod 10) then write(i:5); End.