program t5p4n2;
var n,a,b,c,d,m: integer;
begin
writeln ('vvedit chislo');
readln (n);
writeln ('vvedit chislo yake treba vilychutu');
readln (a);
m:=0;
d:=1;
repeat
c:=n mod 10;
if c<>a then
begin
m:=m+c*d;
d:=d*10;
end;
n:=n div 10;
until n=0;
writeln (m);
readln
end.