#include "testlib.h"
#include <string>
#include <vector>
#include <sstream>
#include <cmath>

using namespace std;

typedef vector<int> vi;

int main(int argc, char * argv[])
{	
    setName("checker for problem 'avia2'");
    registerTestlibCmd(argc, argv);

	int N = inf.readInt();
	int M = inf.readInt();
	vector<int> k(M);
	for (int i = 0; i < M; ++i)
		k[i] = inf.readInt();
	
	string jAns = ans.readLine();
	string uAns = ouf.readLine();
	
	if (uAns == "Epic fail") {
		if (jAns == uAns)
			quitf(_ok, "");
		quitf(_wa, "");
	}
	
	int uN;
	if (sscanf(uAns.c_str(), "%d", &uN) == 0)
		quitf(_pe, "");
		
	int sum = 0;
	vector<int> used(M+1);
	vector<int> u(uN);
	for (int i = 0; i < uN; ++i) {
		u[i] = ouf.readInt(1, M);
		if (used[u[i]])
			quitf(_wa, "some hub used twice");
		used[u[i]] = 1;
		sum += k[u[i]-1];
	}
	sum -= (uN - 1) * 2;
	
	if (sum < N)
		quitf(_wa, "needs more slots");
	
	int jN;
	if (sscanf(jAns.c_str(), "%d", &jN) == 0)
		quitf(_fail, "user has found solution but author not");
		
	if (jN > uN)
		quitf(_fail, "user has found better solution");
		
	if (jN < uN)
		quitf(_wa, "");
	
    quitf(_ok, "ok");
}
