var x,c,c1,n,m,i,j,k:longint;
    a,b: array [1..1000] of byte;
    s:string;
    q:boolean;
begin
readln(n,m);
x:=0;
for i:=1 to m do
begin
read(a[i]);
b[i]:=a[i];
end;
k:=1;
while (k<>0) do
begin
k:=0;
for i:=2 to m do
if a[i]>a[i-1] then begin
c:=a[i-1];
a[i-1]:=a[i];
a[i]:=c;
k:=k+1;
end;end;       k:=2;
j:=1;
for i:=1 to m do
begin
k:=k+a[i]-2;j:=i;
if k>=n then break;
end;
if k<n then write('Epic fail') else begin
writeln(j);
for i:=1 to j do
for k:=1 to m do
if (a[i]=b[k]) then begin  write(k,' '); b[k]:=0; break;
end;
end;
end.




