var n,m,i,j,k,max,z:longint;
    a:array[1..2,1..300] of integer;
begin
  read(n,m);
  for i:=1 to m do
  begin
  read(a[1,i]);
  a[2,i]:=i; end;
  for i:=1 to m-1 do
  begin
    max:=a[1,i];
    k:=i;
    z:=a[2,i];
    for j:=i+1 to m do
    if a[1,j]>max then
    begin
      max:=a[1,j];
      k:=j;
      z:=a[2,j];
    end;
    a[1,k]:=a[1,i];
    a[1,i]:=max;
    a[2,k]:=a[2,i];
    a[2,i]:=z;

  end;

  k:=1;
  max:=a[1,1];
  while (max<(k-1)*2+n) do
  begin
   if k=m then break;inc(k);
    max:=max+a[1,k];

  end;
  if max<(k-1)*2+n then writeln('Epic fail') else begin
  writeln(k);
  for i:=1 to k do
  write(a[2,i],' ');
  writeln;end;
end.

