#include <bits/stdc++.h>

using namespace std;


#define MAX_V 2000

int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];

void add_edge(int from, int to) {
	G[from].push_back(to);
	rG[to].push_back(from);
}
void dfs(int v) {
	used[v] = true;
	for (int i = 0; i < G[v].size(); ++i) {
		if (!used[G[v][i]]) dfs(G[v][i]);
	}
	vs.push_back(v);
}
void rdfs(int v, int k) {
	used[v] = true;
	cmp[v] = k;
	for (int i = 0; i < rG[v].size(); ++i) {
		if (!used[rG[v][i]]) rdfs(rG[v][i], k);
	}
}
int scc() {
	memset(used, 0, sizeof(used));
	vs.clear();
	for (int v = 0; v < V; ++v) {
		if (!used[v]) dfs(v);
	}
	memset(used, 0, sizeof(used));
	int k = 0;
	for (int i = vs.size()-1; i >= 0; --i) {
		if (!used[vs[i]]) rdfs(vs[i], k++);
	}
	return k;
}





struct Bool {
	int type; // 0: literal, 1: and, 2: or
	int vid[2];
	bool isNot[2];
};

bool is_vname(char c) {
	switch (c) {
		case '(':
		case ')':
		case '&':
		case '|':
		case '~':
		case ';':
			return false;

		default:
			return true;
	}
}

Bool Not(Bool b) {
	switch (b.type) {
		case 0:
			b.isNot[0] = !b.isNot[0];
			break;

		case 1:
		case 2:
			b.type == 1 ? 2 : 1;
			for (int i = 0; i < 2; ++i) b.isNot[i] = !b.isNot[i];
			break;

		default:
			cout << "error1" << endl;
			break;
	}
	return b;
}

int nid = 0;
map<string, int> names;
int GetVid(string name) {
	if ( names.find(name) == names.end() ) {
		names[name] = nid++;
	}
	return names[name];
}

void Append(Bool& b1, Bool b2) {
	switch (b1.type) {
		case -1:
			b1 = b2;
			break;

		case 0:
			cout << "error2" << endl;
			break;

		case 1:
		case 2:
			if (b2.type != 0) cout << "error3" << endl;
			b1.vid[1] = b2.vid[0];
			b1.isNot[1] = b2.isNot[0];
			break;
	}
}

void PrintNot(bool f) {
	if (f) cout << "~";
}
void PrintBool(Bool b) {
	cout << "b:";
	switch (b.type) {
		case -1:
			cout << "-1" << endl;
			break;

		case 0:
			PrintNot(b.isNot[0]);
			cout << b.vid[0] << endl;
			break;

		case 1:
			PrintNot(b.isNot[0]);
			cout << b.vid[0];
			cout << "&";
			PrintNot(b.isNot[1]);
			cout << b.vid[1];
			cout << endl;
			break;

		case 2:
			PrintNot(b.isNot[0]);
			cout << b.vid[0];
			cout << "|";
			PrintNot(b.isNot[1]);
			cout << b.vid[1];
			cout << endl;
			break;

		default:
			cout << "error10" << endl;
			break;
	}
}

Bool Parse(string& str, int& pos);
Bool Literal(string& str, int& pos) {
	Bool ret; ret.type = -1;
	while (pos < str.size()) {
		switch (str[pos]) {
			case '(':
				++pos;
				return Parse(str, pos);
				break;

			case '~':
				++pos;
				ret = Not( Literal(str, pos) );
				break;

			case ')':
			case ';':
			case '&':
			case '|':
				return ret;
				break;

			default:
				{
					string vname = "";
					while (pos < str.size() && is_vname(str[pos])) {
						vname += str[pos];
						++pos;
					}
					Bool b;
					b.type = 0;
					b.vid[0] = GetVid(vname);
					b.isNot[0] = false;
					return b;
				}
				break;
		}
	}
	return ret;
}
Bool Parse(string& str, int& pos) {
	Bool ret; ret.type = -1;
	while (pos < str.size()) {
		switch (str[pos]) {
			case '(':
				{
					++pos;
					Append(ret, Parse(str, pos));
				}
				break;

			case ')':
				{
					++pos;
					return ret;
				}
				break;

			case ';':
				return ret;
				break;

			case '~':
				++pos;
				Append(ret, Not( Literal(str, pos) ));
				break;

			case '&':
				ret.type = 1;
				++pos;
				break;

			case '|':
				ret.type = 2;
				++pos;
				break;

			default:
				Append(ret, Literal(str, pos));
				break;
		}
	}
	return ret;
}

/*
struct Bool {
	int type; // 0: literal, 1: and, 2: or
	int vid[2];
	bool isNot[2];
};
*/

int GetVid(int v, Bool b, int id) {
	int base = b.isNot[id] ? v/2 : 0;
	return base + b.vid[id];
}
int main() {
	vector<Bool> v;
	int n, m; cin >> n >> m;
	for (int i = 0; i < n; ++i) {
		string str; cin >> str;
		int pos = 0; Bool b = Parse(str, pos);
		if (b.type == 1) {
			for (int i = 0; i < 2; ++i) {
				Bool bb;
				bb.type = 0;
				bb.vid[0] = b.vid[i];
				bb.isNot[0] = b.isNot[i];
				v.push_back(bb);
			}
		}
		else {
			v.push_back(b);
		}
	}

	V = 2*m;
	for (int i = 0; i < v.size(); ++i) {
//		PrintBool(v[i]);
		// a -> a v a
		if (v[i].type == 0) {
			v[i].type = 2;
			v[i].vid[1] = v[i].vid[0];
			v[i].isNot[1] = v[i].isNot[0];
		}

		// a v a -> a
		if (v[i].vid[0] == v[i].vid[1] && v[i].isNot[0] == v[i].isNot[1]) {
			Bool b = v[i];
			b.isNot[0] = !b.isNot[0];
			add_edge(GetVid(V, b, 0), GetVid(V, b, 1));
		}
		else {
			{
				Bool b = v[i];
				b.isNot[0] = !b.isNot[0];
				add_edge(GetVid(V, b, 0), GetVid(V, b, 1));
			}
			{
				Bool b = v[i];
				b.isNot[1] = !b.isNot[1];
				add_edge(GetVid(V, b, 1), GetVid(V, b, 0));
			}
		}
	}
	scc();

	bool ans = true;
	for (int i = 0; i < V/2; ++i) {
		if (cmp[i] == cmp[i+V/2]) {
			ans = false;
		}
	}
	if (ans) cout << "accept" << endl;
	else cout << "reject" << endl;
}

Measured memory_bytes: 1428