program Project4;


uses
  SysUtils;

Var
    f,g:text;
    i,j,plmax,sch,n,m:integer;
    a,b:array[1..1000] of integer;
    c:string;
    c1,q,max,sum,z,x:integer;

begin
    assign(f,'STDIN.txt');
    assign(g,'STDOUT.txt');
    reset(f);
    read(f,n,m);
         rewrite(g);
    for i:=1 to m do
    begin
        read(f,a[i]);
        sum:=sum+a[i];
        b[i]:=i;
    end;  x:=0; sch:=0;
    for i:=1 to m-1 do
    begin
         for j:=i to m do
         if a[i]<a[j] then
         begin
              z:=a[i];
              a[i]:=a[j];
              a[j]:=z;
              z:=b[i];
              b[i]:=b[j];
              b[j]:=z;
         end;
    end;
    if sum-n<0 then
        begin
          write(g,'Epic fail');
          close(f);
          close(g);
          halt;
        end;

    for i:=1 to m do
    begin
        if i>1 then x:=i;
        n:=n-a[i]+x;
        sch:=sch+1;
        if n<=0 then
           begin
                write(g,sch);
                writeln(g);
                for j:=1 to sch do
                write(g,b[j],' ');
                  close(f);
                  close(g);
                halt;
        end;
    end;
    if n>0 then
        begin
         write(g,'Epic fail');
          close(f);
          close(g);
         halt;
        end;
    writeln(g,sch);
    for j:=1 to sch do
    write(g,b[j],' ');
    close(f);
    close(g);
end.
