type z=array of integer;
var n,i: integer;
a: z;
f: boolean;
begin
readln(n);
i:=0;
f:=true;
setlength(a,i+1);
while n<>0 do begin
a[i]:=n mod 10;
i:=i+1;
n:=n div 10;
end;
setlength(a,i);
for i:=0 to 9 do begin
for n:=0 to length(a)-1 do
if a[n]=i then begin
f:=false;
break;
if f then write(i,' ');
end.
var
i, n: integer;
m: array[0..9] of boolean;
for i := 0 to 9 do
m[i] := False;
read(n);
while n > 0 do
m[n mod 10] := True;
n := n div 10
if not m[i] then
Write(i, ' ')
type z=array of integer;
var n,i: integer;
a: z;
f: boolean;
begin
readln(n);
i:=0;
f:=true;
setlength(a,i+1);
while n<>0 do begin
a[i]:=n mod 10;
i:=i+1;
setlength(a,i+1);
n:=n div 10;
end;
setlength(a,i);
for i:=0 to 9 do begin
for n:=0 to length(a)-1 do
if a[n]=i then begin
f:=false;
break;
end;
if f then write(i,' ');
f:=true;
end;
end.
var
i, n: integer;
m: array[0..9] of boolean;
begin
for i := 0 to 9 do
m[i] := False;
read(n);
while n > 0 do
begin
m[n mod 10] := True;
n := n div 10
end;
for i := 0 to 9 do
if not m[i] then
Write(i, ' ')
end.