program abs;
var
a,b : array [1..6] of integer;
i : integer;
begin
for i:=1 to 6 do
read(a[i]);
for i:=1 to 3 do
read(b[i]);
if (a[i]<>b[1]) and (a[i]<>b[2]) and (a[i]<>b[3]) then write(a[i],' ');
end.
program abs;
var
a,b : array [1..6] of integer;
i : integer;
begin
for i:=1 to 6 do
read(a[i]);
for i:=1 to 3 do
read(b[i]);
for i:=1 to 6 do
if (a[i]<>b[1]) and (a[i]<>b[2]) and (a[i]<>b[3]) then write(a[i],' ');
end.