#include <iostream>
#include <vector>
#include <set>
#include <cctype>
#include <stack>
#include <map>

using namespace std;

class range {
private:
  struct Iterator {
    int val;
    int operator*() {return val;}
    bool operator!=(Iterator &itr) {return val < itr.val;}
    void operator++() {++val;}
  };
  Iterator i, n;
public:
  range(int n) : i({0}), n({n}) {}
  range(int i, int n) : i({i}), n({n}) {}
  Iterator &begin() {return i;}
  Iterator &end() {return n;}
};

template<class T> T at(vector<T> v, int i) {return v[(i % (int)v.size() + v.size()) % v.size()];}

#include <algorithm>

class SCC{
private:
  int v;
  vector<vector<int>> g, rg;
  vector<int> cmp, vs;
  vector<bool> used;

  void dfs(const int v) {
    used[v] = true;
    for (int to : g[v]) if(!used[to]) dfs(to);
    vs.push_back(v);
  }
  
  void rdfs(const int v, const int k){
    cmp[v] = k;
    for (int to : rg[v]) if(cmp[to] == -1) rdfs(to, k);
  }
  
public:
  SCC() : v(0) {}
  
  int next() {
    g.emplace_back(vector<int>());
    rg.emplace_back(vector<int>());
    return v++;
  }
  
  void add_edge(int from, int to){
    g[from].push_back(to);
    rg[to].push_back(from);
  }
  
  int run() {
    used = vector<bool>(v, false);
    for (int i : range(v)) if(!used[i]) dfs(i);
    int k = 0;
    cmp = vector<int>(v, -1);
    reverse(vs.begin(), vs.end());
    for (int v : vs) if(cmp[v] == -1) rdfs(v, k++);
    return k;
  }

  int sgn(int a, int b) const {return cmp[a] > cmp[b] ? 1 : cmp[a] < cmp[b] ? -1 : 0;}
};

void simple(string &s) {
  int x = -1, y = -1;
  for (int i : range(s.size())) if (isalpha(s[i])) {
    if (x == -1) x = i;
    y = i;
  }
  vector<int> a, b;
  stack<int> st;
  for (int i : range(s.size())) {
    if (s[i] == '(') {
      st.push(a.size());
      a.emplace_back(i);
      b.emplace_back(0);
    }
    if (s[i] == ')') {
      b[st.top()] = i;
      st.pop();
    }
  }
  if (s.find("&") == string::npos && s.find("|") == string::npos) {
    for (int i : range(a.size())) {
      s[a[i]] = ' ';
      s[b[i]] = ' ';
    }
  }
  for (int i : range(a.size())) if (x < a[i] || b[i] < y) {
    s[a[i]] = ' ';
    s[b[i]] = ' ';
  }
  for (int i : range((int)a.size() - 1)) if (a[i + 1] < x && y < b[i + 1]) {
    s[a[i]] = ' ';
    s[b[i]] = ' ';
  }
  string ss;
  for (int i : range(s.size())) if (s[i] != ' ') ss += s[i];
  s = ss;
  int t;
  while ((t = s.find("~~")) != (int)string::npos) s = s.substr(0, t) + s.substr(t + 2);
  t = -1;
  if (s.find("&") != string::npos) t = s.find("&");
  if (s.find("|") != string::npos) t = s.find("|");
  if (t != -1 && s.find("(") != string::npos) {
    if (s[0] == '(') s = s.substr(1, s.size() - 2);
    else if (s.find("&") != string::npos) s = "~" + s.substr(2, t - 2) + "|~" + s.substr(t + 1, s.size() - t - 2);
    else s = "~" + s.substr(2, t - 2) + "&~" + s.substr(t + 1, s.size() - t - 2);
  } 
  while ((t = s.find("~~")) != (int)string::npos) s = s.substr(0, t) + s.substr(t + 2);
}

bool solve2SAT(const vector<pair<int, int>> &clauses, const vector<int> &tvals, int n, vector<bool> &res) {
  SCC scc;
  vector<int> v(n), nv(n);
  for (int i : range(n)) v[i] = scc.next();
  for (int i : range(n)) nv[i] = scc.next();
  for (const auto &c : clauses) {
    if (0 <= c.first) {
      if (0 <= c.second) {
        scc.add_edge(nv[c.first], v[c.second]);
        scc.add_edge(nv[c.second], v[c.first]);
      } else {
        scc.add_edge(nv[c.first], nv[~c.second]);
        scc.add_edge(v[~c.second], v[c.first]);
      }
    } else {
      if (0 <= c.second) {
        scc.add_edge(v[~c.first], v[c.second]);
        scc.add_edge(nv[c.second], nv[~c.first]);
      } else {
        scc.add_edge(v[~c.first], nv[~c.second]);
        scc.add_edge(v[~c.second], nv[~c.first]);
      }
    }
  }
  for (int c : tvals) {
    if (0 <= c) scc.add_edge(nv[c], v[c]);
    else scc.add_edge(v[~c], nv[~c]);
  }
  scc.run();
  for (int i : range(n)) if (scc.sgn(v[i], nv[i]) == 0) return false;
  res.clear();
  for (int i : range(n)) res.push_back(scc.sgn(v[i], nv[i]) > 0);
  return true;
}

int main() {
  int n, m;
  cin >> n >> m;
  string cond[n];
  for (int i : range(n)) cin >> cond[i];
  for (int i : range(n)) cond[i] = cond[i].substr(0, cond[i].size() - 1);
  for (int i : range(n)) simple(cond[i]);
  set<string> val;
  for (int i : range(n)) for (int j : range(cond[i].size())) {
    if ((j == 0 || !isalpha(cond[i][j - 1])) && isalpha(cond[i][j])) {
      int k = j;
      while (k < (int)cond[i].size() && isalpha(cond[i][k])) ++k;
      val.insert(cond[i].substr(j, k - j));
      j = k - 1;
    }
  }
  map<string, int> id;
  for (const auto &v : val) {
    int t = id.size();
    id[v] = t;
  }
  vector<pair<int, int>> clauses;
  vector<int> tvals;
  for (int i : range(n)) {
    int t = cond[i].find("&");
    if ((t = cond[i].find("&")) != (int)string::npos) {
      string a = cond[i].substr(0, t);
      string b = cond[i].substr(t + 1);
      if (a[0] == '~') tvals.emplace_back(~id[a.substr(1)]);
      else tvals.emplace_back(id[a]);
      if (b[0] == '~') tvals.emplace_back(~id[b.substr(1)]);
      else tvals.emplace_back(id[b]);
    } else if ((t = cond[i].find("|")) != (int)string::npos) {
      string a = cond[i].substr(0, t);
      string b = cond[i].substr(t + 1);
      if (a[0] == '~') {
        if (b[0] == '~') clauses.emplace_back(~id[a.substr(1)], ~id[b.substr(1)]);
        else clauses.emplace_back(~id[a.substr(1)], id[b]);
      } else {
        if (b[0] == '~') clauses.emplace_back(id[a], ~id[b.substr(1)]);
        else clauses.emplace_back(id[a], id[b]);
      }
    } else {
      if (cond[i][0] == '~') tvals.emplace_back(~id[cond[i].substr(1)]);
      else tvals.emplace_back(id[cond[i]]);
    }
  }
  vector<bool> res;
  if (solve2SAT(clauses, tvals, id.size(), res)) cout << "accept" << endl;
  else cout << "reject" << endl;
}

Measured memory_bytes: 1436