#include <stdio.h>

int get_next(char *fg,int *h,int m)
{
  int y=0;
  int max=-1; 
  int my=-1;
  for (y=0;y<m;y++)
  {
	  if((h[y]>max)&&(fg[y]==0)){
		  max=h[y];my=y;
	  }
  }
 return my;
}
int main()
{ int N,M;
 int CU=0;
 int HU=0;
  int i,b;
	scanf("%d %d",&N,&M);
	int *hb = new int[M];
	char *flg = new char[M];
	for(i=0;i<M;i++)
	{
		scanf("%d",&b);
		hb[i]=b;
		flg[i]=0;
	}

	while((CU<(N+((HU-1)*2)))&&( b>=0))
	{ 
        b=get_next(flg,hb,M);
		if(b>=0)
		{
		CU=CU+hb[b];
		flg[b]=1;
		 HU++;
		}
	}
	if(  (  CU<(N+(HU-1)*2) )  && ( b<0) )
	{
		printf("Epic fail");
	}
	else
	{
		printf("%d\n",HU);
		for(i=0;i<M;i++){if (flg[i]>0){printf("%d ",i+1);}}
	}


}

