program vid; //{$APPTYPE CONSOLE} //uses // SysUtils; var t,a,b,c:array[1..10000] of integer; n,m,k,i,j:integer; s:char; f1,f2:text; begin assign(f1,'long.txt'); reset(f1); n:=0; while not(eoln(f1)) do begin read(f1,s); if s='0' then begin n:=n+1;t[n]:=0;end; if s='1' then begin n:=n+1;t[n]:=1;end; if s='2' then begin n:=n+1;t[n]:=2;end; if s='3' then begin n:=n+1;t[n]:=3;end; if s='4' then begin n:=n+1;t[n]:=4;end; if s='5' then begin n:=n+1;t[n]:=5;end; if s='6' then begin n:=n+1;t[n]:=6;end; if s='7' then begin n:=n+1;t[n]:=7;end; if s='8' then begin n:=n+1;t[n]:=8;end; if s='9' then begin n:=n+1;t[n]:=9;end; //writeln(s,' ',n, ' ',t[n]); //readln; //if c in ['0'..'9'] then begin n:=n+1; t[n]:=ord(c)-48; end; end; for i:=n downto 1 do a[n-i+1]:=t[i]; readln(f1,s); m:=0; while not(eoln(f1)) do begin read(f1,s); if s='0' then begin m:=m+1;t[m]:=0;end; if s='1' then begin m:=m+1;t[m]:=1;end; if s='2' then begin m:=m+1;t[m]:=2;end; if s='3' then begin m:=m+1;t[m]:=3;end; if s='4' then begin m:=m+1;t[m]:=4;end; if s='5' then begin m:=m+1;t[m]:=5;end; if s='6' then begin m:=m+1;t[m]:=6;end; if s='7' then begin m:=m+1;t[m]:=7;end; if s='8' then begin m:=m+1;t[m]:=8;end; if s='9' then begin m:=m+1;t[m]:=9;end; //if c in ['0'..'9'] then begin n:=n+1; t[n]:=ord(c)-48; end; end; for i:=m downto 1 do b[m-i+1]:=t[i]; close(f1); k:=n; for i:=1 to k do if a[i]>=b[i] then c[i]:=a[i]-b[i] else begin c[i]:=a[i]+10-b[i];a[i+1]:=a[i+1]-1;end; i:=k; while (c[i]=0) and (i>1)do i:=i-1; k:=i; assign(f2,'rez.txt'); rewrite(f2); for i:=k downto 1 do write(f2,c[i]); writeln(f2); close(f2); end.