program sub;
var a,b:array[1..100]of integer;
ans:array[1..100]of integer;
i,j,k,l,t:longint;
s1,s2:string;
begin
assign(input,'sub.in');
assign(output,'sub.out');
reset(input);
rewrite(output);
readln(s1);
readln(s2);
l:=0;
if (s1>=s2)or(length(s1)>length(s2)) then begin
k:=0;
j:=length(s1);
if j>l then l:=j;
for i:=j downto 1 do begin
k:=k+1;
val(s1[i],a[k],t);
end;
k:=0;
j:=length(s2);
if j>l then l:=j;
for i:=j downto 1 do begin
k:=k+1;
val(s2[i],b[k],t);
end;
for i:=1 to l do begin
if a[i]>=b[i] then ans[i]:=a[i]-b[i]
else begin
a[i+1]:=a[i+1]-1;
a[i]:=a[i]+10;
ans[i]:=a[i]-b[i];
end;
end;
i:=l;
while (ans[i]=0)and(i>1) do i:=i-1;
for j:=i downto 1 do write(ans[j]);
end
else begin
k:=0;
j:=length(s1);
if j>l then l:=j;
for i:=j downto 1 do begin
k:=k+1;
val(s1[i],b[k],t);
end;
k:=0;
j:=length(s2);
if j>l then l:=j;
for i:=j downto 1 do begin
k:=k+1;
val(s2[i],a[k],t);
end;
for i:=1 to l do begin
if a[i]>=b[i] then ans[i]:=a[i]-b[i]
else begin
a[i+1]:=a[i+1]-1;
a[i]:=a[i]+10;
ans[i]:=a[i]-b[i];
end;
end;
i:=l;
while ans[i]=0 do i:=i-1;
write('-');
for j:=i downto 1 do write(ans[j]);
end;
close(input);
close(output);
end.