program a1;
var n,i:integer;a:array[1..100] of integer;
begin
write ('n'); readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do if abs(a[i]) mod 7=0
then write (a[i],'');
readln
end.
program a1;
var n,i:integer;a:array[1..100] of integer;
begin
write ('n'); readln(n);
for i:=1 to n do
readln(a[i]);
for i:=1 to n do if abs(a[i]) mod 7=0
then write (a[i],'');
readln
end.