var a:array[1..15]of integer;
b:array[1..15]of boolean;
i,s:integer;
begin
for i:=1 to 15 do begin
readln(a[i]);
if a[i]<10 then s:=s+a[i];
if (a[i] mod 3=0) and{or} (a[i] mod 5=0) then b[i]:=true;
end;
for i:=1 to 15 do if b[i]=true write(i,' ');
writeln(s);
end.
i,k:integer; c:boolean;
readln(k);
for i:=1 to 15 do readln(a[i]);
for i:=1 to 14 do if a[i]+a[i+1]=k then begin writeln('est'); c:=true; break; end;
if c=false then writeln('net');
var a:array[1..15]of integer;
b:array[1..15]of boolean;
i,s:integer;
begin
for i:=1 to 15 do begin
readln(a[i]);
if a[i]<10 then s:=s+a[i];
if (a[i] mod 3=0) and{or} (a[i] mod 5=0) then b[i]:=true;
end;
for i:=1 to 15 do if b[i]=true write(i,' ');
writeln(s);
end.
var a:array[1..15]of integer;
i,k:integer; c:boolean;
begin
readln(k);
for i:=1 to 15 do readln(a[i]);
for i:=1 to 14 do if a[i]+a[i+1]=k then begin writeln('est'); c:=true; break; end;
if c=false then writeln('net');
end.