program test;
var a: array [1..7] of integer;
i: integer;
begin
for i:=1 to 7 do read(a[i]);
for i:=1 to 7 do
if a[i] mod 2 = 0 then a[i]:=0
else a[i]:=1;
writeln;
for i:=1 to 7 do write(a[i],' ')
end.
program test;
var a: array [1..7] of integer;
i: integer;
begin
for i:=1 to 7 do read(a[i]);
for i:=1 to 7 do
if a[i] mod 2 = 0 then a[i]:=0
else a[i]:=1;
writeln;
for i:=1 to 7 do write(a[i],' ')
end.