program sum_long; var a,b,array[0..100000] 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]; ost:=0; for i:=1 to c[0] do begin c[i]:=(a[i]+b[i]+ost) mod 10; ost:=(a[i]+b[i]+ost) div 10; end; if ost>0 then begin c[0]:=c[0]+1;c[c[0]]:=ost;end; assign(f,'long.sol'); rewrite(f); for i:=c[0] downto 1 do write(f,c[i]); close(f); end.