#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 'k13'");
    registerTestlibCmd(argc, argv);

	int N = inf.readInt();
	int M = inf.readInt();

	vector<vi> e(N, vi(N));
	
	for (int i = 0; i < M; ++i) {
		int a, b;
		a = inf.readInt(1, N);
		b = inf.readInt(1, N);
		--a; --b;
		e[a][b] = e[b][a] = 1;
	}
	
	int jAns = ans.readInt();
	int uAns = ouf.readInt();
	
	if (uAns < jAns)
		quitf(_wa, "author can better");
	
	vi was(N);
	vi order;
	for (int i = 0; i < uAns; ++i) {
		int v = ouf.readInt(1, N) - 1;
		if (was[v])
			quitf(_wa, "duplicate vertex %d", v + 1);
		was[v] = 1;
		if (order.size() == 0 && v != 0)
			quitf(_wa, "first number must be 1");
		order.push_back(v);
	}	

	if (order.size() > 1) {
		order.push_back(order[0]);
		for (int i = 0; i + 1 < order.size(); ++i)
			if (e[order[i]][order[i+1]] == 0)
				quitf(_wa, "can not move article from %d to %d", order[i] + 1, order[i+1] + 1);
	}
	
	if (uAns > jAns)
		quitf(_fail, "user can better");
	
    quitf(_ok, "ok");
}
