program Project4;

{$APPTYPE CONSOLE}

uses
  SysUtils;

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

begin

    read(n,m);
    for i:=1 to m do
    begin
        read(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('Epic fail');
          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(sch);
                writeln;
                for j:=1 to sch do
                write(b[j],' ');
                halt;
        end;
    end;
    if n>0 then
        begin
            write('Epic fail');
            halt;
        end;
    writeln(sch);
    for j:=1 to sch do
    write(b[j],' ');
end.
