#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define int64 long long
#define uint64 unsigned long long
#define pb push_back
#define mp make_pair


int main() {
	int n, m, i;
	cin >> n >> m;
	vector <int> h(m);
	for (i = 0; i < m; ++i) {
		cin >> h[i];
	}
	
	vector<int> used;
	int s = 0;
	while (used.size() < m) {
		int max = h[0], maxi = 0;
		for (i = 1; i < m; ++i) {
			if (h[i] > max) { max = h[i]; maxi = i; }
		}

		used.pb(maxi + 1);
		s += max;
		h[maxi] = 0;
		if (s - ((used.size() - 1) * 2) >= n) break;
	}

	if (s - ((used.size() - 1) * 2) >= n) {
		cout << used.size() << endl;
		for (i = 0; i < used.size(); ++i) cout << used[i] << ' ';
		cout << endl;
	}
	else cout << "Epic fail" << endl;
	return 0;
}