var x,i,j,n,m,maxs,k,s,c:integer;t,t1:text;a:array[1..1000] of integer;
begin
assign(t,'input.txt');
assign(t1,'output.txt');
reset(t);rewrite(t1);
readln(t,n,m);
for i:=1 to m do
   begin
        read(t,a[i]);s:=a[i]+s;
   end;
i:=1;
if s>n then
repeat
c:=a[i]+c;
if c>=n then           begin  writeln(t1,i);
for j:=1 to i do
write(t1,j,' ');k:=1      end;
i:=i+1;c:=c-2;
if c<0 then c:=n+10;
until c+2>=n;
if k<>1 then writeln(t1,'Epic fail');

close(t);close(t1);
end.





