program d;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  n,a,b:string [101]; s1: string [1];

  x:array[1..101] of integer;
  y:array[1..101] of integer;
  k,i:integer;
  f, f1 : textfile;
  begin
{read(n,a,b);}
 {n:='10';
 a:='7';
 b:='3';}

 assign (input, 'd.in'); reset (input);
 assign (output, 'd.out'); rewrite (output);

   read (s1);
    {if (s1 <> ' ') and (s2 = 'n') then n:=n + s1 else
    if (s1 = ' ') and (s2 = 'n') then s2:='a';

    if (s1 <> ' ') and (s2 = 'a') then a:=a + s1 else
    if (s1 = ' ') and (s2 = 'a') then s2:='b';

    if s2 = 'b' then b:=b + s1;
  until s1 = chr (13);}
 n:='';
  while (s1 <>' ') do begin
   n:=n + s1;
   read (s1);
  end;

 a:='';   read (s1);
  while (s1 <> ' ') do begin
   a:=a + s1;
   read (s1);
  end;
 b:='';
  while not eof(input) do begin
   read (s1);
   b:=b + s1;

  end;


for i:=length(a) downto (length(a)-length(b)+1) do
x[i]:=strtoint(a[i])-strtoint(b[i-length(a)+length(b)]);

for i:=length(a)-length(b) downto 1 do
x[i]:=strtoint(a[i]);

for i:=length(a) downto 2 do
begin
if (x[i]<0) then
begin
x[i]:=x[i]+10;
x[i-1]:=x[i-1]-1;
end;
end;


for i:=length(n) downto (length(n)-length(a)+1) do
y[i]:=strtoint(n[i])-x[i-length(n)+length(a)];

for i:=length(n)-length(a) downto 1 do
y[i]:=strtoint(n[i]);

for i:=length(n) downto 2 do
begin
if (y[i]<0) then
begin
y[i]:=y[i]+10;
y[i-1]:=y[i-1]-1;
end;

end;
k:=1;
while(y[k]=0)
do
begin
k:=k+1;
end;

for i:=k to length(n) do write(y[i]);



close(output);
end.
