#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool compare(pair<int, int> i,
			 pair<int, int> j) {

	return i.first > j.first;
}


int main () {

	int n, m, all = 0;
	cin >> n >> m;

	vector<pair<int, int> > a(m);
	vector<int> numbers;

	for(int i = 0; i < m; i++) {
		int k;
		cin >> k;
		a[i] = make_pair(k, i+1);
	}

	sort(a.begin(), a.end(), compare);

	int habcount = 0, ost = n, end = 0;
	bool isContinue = true;

	while (end < m) {
		habcount += 1;
		numbers.push_back(a[end].second);
		if(a[end].first >= ost) 
			isContinue = false;
		ost -= a[end].first;
		all += a[end].first;
		if(!isContinue) break;
		end += 1;
	}

	if(ost > 0) {
		cout << "Epic fail";
		return 0;
	}

	int scount = 0;
	if(habcount >= 2) {
		scount = 2 + ((habcount - 2) * 2);
	}

	if((all - scount) >= n) {
		cout << habcount << endl;
		for(unsigned i = 0; i < numbers.size(); i++)
			cout << numbers[i] << ' ';
		return 0;
	}

	scount -= (all - n);

	while (scount > 0) {
		end += 1;
		if(end >= m) break;
		habcount += 1;
		numbers.push_back(a[end].second);
		scount -= a[end].first;
		scount += 2;
	}

	if(scount > 0) {
		cout << "Epic fail";
		return 0;
	}

	cout << habcount << endl;
	for(unsigned i = 0; i < numbers.size(); i++)
		cout << numbers[i] << ' ';
	return 0;
}