#include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

int k[301];
int index[301];
int main()
{ 
    int n,m;
    cin>>n>>m;
	for(int i = 0; i<m;i++)
	{
		cin>>k[i];
		index[i] = i;
	}

	for	(int i = 0; i<m-1;i++)
		for(int j = i;j<m;j++)
			if(k[index[i]]<k[index[j]])
			{
				int buf = index[j];
				index[j]=index[i];
				index[i] = buf;
			}
int cur = 0;
int sum = k[index[0]];
while(sum<n)
{
cur++;
if(cur>= m)
{
	cout<<"Epic fail";
//system("Pause");
	return 0;
}
n+=2;
sum+=k[index[cur]];
}

cout << cur+1<<endl;
for(int i = 0;i<=cur;i++)
    cout<<index[i]+1<<" ";
//system("Pause");
	return 0;
}

