#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <cctype>
using namespace std;

const int MAXV = 2000;
const int MAXN = 501;
const string S_TRUE = "TTTTTTTTTTT";
const string S_FALSE = "~" + S_TRUE;

int N, M;
string cond[MAXN];
map<string,int> id;

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

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() {
  vs.clear();
  fill(used, used+V, false);
  for(int i = 0; i < V; ++i) {
    if(!used[i]) dfs(i);
  }
  fill(used, used+V, false);
  int k = 0;
  for(int i = vs.size()-1; i >= 0; --i) {
    if(!used[vs[i]]) rdfs(vs[i], k++);
  }
  return k;
}

void addEdge(int a, int b) {
  G[a].push_back(b);
  rG[b].push_back(a);
}

int getId(const string &name) {
  if(!id.count(name)) id[name] = id.size()-1;
  return id[name];
}

pair<string, bool> parse(const string &s) {
  pair<string,bool> res;
  for(int i = 0; i < s.size(); ++i) {
    if(isalpha(s[i])) res.first += s[i];
  }
  res.second = (count(s.begin(), s.end(), '~') & 1);
  return res;
}

void AorB(const pair<string,bool> &pa, const pair<string,bool> &pb) {
  addEdge(getId(pa.first) + (pa.second^1), getId(pb.first) + pb.second);
  addEdge(getId(pb.first) + (pb.second^1), getId(pa.first) + pa.second);
}

void add(const string &s) {
  int m;
  for(m = 0; m < s.size(); ++m) {
    if(s[m] == '&' || s[m] == '|') {
      break;
    }
  }

  bool isAnd;
  string P, A, B;
  if(m == s.size()) {
    isAnd = false;
    P = "";
    A = s;
    B = S_FALSE;
  } else {
    isAnd = (s[m] == '&');
    B = s.substr(m+1);
    for(int i = m-1, c = 0; i >= 0; --i) {
      if(s[i] == '(') {
        if(c-- == 0) {
          ++i;
          P = s.substr(0, i);
          A = s.substr(i, m-i);
          break;
        }
      } else if(s[i] == ')') {
        ++c;
      }
    }
  }

  pair<string,bool> pp, pa, pb;
  pp = parse(P);
  pa = parse(A);
  pb = parse(B);

  isAnd ^= pp.second;
  pa.second ^= pp.second;
  pb.second ^= pp.second;

  if(isAnd) {
    AorB(pa, make_pair(S_TRUE, 1));
    AorB(pb, make_pair(S_TRUE, 1));
  } else {
    AorB(pa, pb);
  }
}

int main() {
  cin >> N >> M;
  for(int i = 0; i < N; ++i) {
    cin >> cond[i];
    cond[i] = "(" + cond[i].substr(0,cond[i].size()-1) + ")";
  }
  
  getId(S_TRUE);
  getId(S_FALSE);
  for(int i = 0; i < N; ++i) {
    string tmp = "";
    for(int j = 0; j < cond[i].size(); ++j) {
      if(isalpha(cond[i][j])) {
        tmp += cond[i][j];
      } else if(tmp.size()) {
        getId(tmp);
        getId("~" + tmp);
        tmp = "";
      }
    }
  }

  V = id.size();
  addEdge(getId(S_FALSE), getId(S_TRUE));
  for(int i = 0; i < N; ++i) {
    add(cond[i]);
  }

  scc();
  bool flag = true;
  for(int i = 0; i < V; i += 2) {
    if(cmp[i] == cmp[i+1]) {
      flag = false;
      break;
    }
  }
  if(flag) cout << "accept" << endl;
  else cout << "reject" << endl;
  return 0;
}

Measured memory_bytes: 1500