var a,n: integer;
procedure del (a,n:integer);
var b:integer;
begin
b := 0;
while a > 0 do
begin
if a mod 10 <> n then b := b * 10 + a mod 10;
a := a div 10
end;
while b > 0 do
begin
a:= a * 10 + b mod 10;
b := b div 10
end;
writeln(a)
end;
begin
readln(a);
readln(n);
del(a,n)
end.