program main_long; var a,b,c:array[0..1000] of integer; i:integer; f:text; ch:char; ost:integer; begin assign(f,'long.dat'); reset(f); for i:=0 to 1000 do a[i]:=0; while not(eoln(f)) do begin read(f,ch); if ch in ['0'..'9'] then begin for i:=a[0] downto 1 do a[i+1]:=a[i]; a[0]:=a[0]+1; a[1]:=ord(ch)-ord('0'); end; end; for i:=0 to 1000 do b[i]:=0; while not(eof(f)) do begin read(f,ch); if ch in ['0'..'9'] then begin for i:=b[0] downto 1 do b[i+1]:=b[i]; b[0]:=b[0]+1; b[1]:=ord(ch)-ord('0'); end; end; close (f); if a[0]>b[0] then c[0]:=a[0] else c[0]:=b[0]; for i:=1 to c[0] do begin if a[i]>b[i] then c[i]:=a[i]-b[i] else c[i]:=10+a[i]-b[i]; end; assign(f,'long.sol'); rewrite(f); WHILE C[c[0]]=0 do c[0]:=c[0]-1; FOR i:=c[0] downto 1 do write(f,c[i]); close(f); end.