#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, j;
	cin >> n >> m;
	int s = 0;
	vector <int> h(m);
	for (i = 0; i < m; ++i) {
		cin >> h[i];
		s += h[i];
	}
	int k = 0;
		vector<int> used;
		while (n > 0 && k < m) {
			int max = h[0];
			int maxi = 0;
			for (i = 1; i < m; ++i) {
				if (h[i] > max) { max = h[i]; maxi = i; }
			}
			used.pb(1 + maxi);
			n -= h[maxi] - (used.size() - 1) * 2;
			h[maxi] = 0;
			++k;
		}
		if (k == m && n > 0) cout << "Epic fail" << endl;
		else {
		cout << used.size() << endl;
		for (i = 0; i < used.size(); ++i) cout << used[i] << ' ';
		cout << endl;
		}

	return 0;
}