#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;
	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;

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

	if(ost > 0) {
		cout << "Epic fail";
		return 0;
	}
	
	cout << habcount << endl;
	for(unsigned i = 0; i < numbers.size(); i++)
		cout << numbers[i] << ' ';
}