#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<sstream>
#include<map>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<string>
#include<cassert>
#define MAX_V 1200
using namespace std;
typedef vector<string> VS;
typedef vector<VS> VVS;
int N,M;
map<string,int> Index;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];
int V;

class Parsing{
private:
  string parse;
  int pos;
public:
 
  Parsing(string s){
    parse = s;
    pos = 0;
  }

  string fact(){
    if(parse[pos] == '('){
      pos++;
      string p = expression();
      pos++;
      return p;
    }else{
      string p; 
      while('a' <= tolower(parse[pos]) && tolower(parse[pos]) <= 'z'){
	p += parse[pos];
	pos++;
      }
      return p;
    }
  }
  
  string term(){
    int cnt = 0;
    while(parse[pos] == '~')
      pos++,cnt++;

    string p = fact();  
    if(cnt%2)
      {
	int st = 0;
	vector<string> vec;

	for(int i=0;i<=p.size();i++)
	  {
	    if(i == p.size() || p[i] == '|' || p[i] == '&')
	      {
		vec.push_back(p.substr(st,i-st));
		if(i != p.size() && (p[i] == '|' || p[i] == '&'))
		  vec.push_back(p.substr(i,1));
		st = i+1;
	      }
	  }
       
	assert(vec.size() == 1 || vec.size() == 3);
	if(vec[0][0] == '~')
	  vec[0] = vec[0].substr(1,vec[0].size()-1);
	else
	  vec[0] = "~"+vec[0];

	if(vec.size() >= 3 && vec[2][0] == '~')
	  vec[2] = vec[2].substr(1,vec[2].size()-1);
	else if(vec.size() >= 3 && vec[2][0] != '~')
	  vec[2] = "~"+vec[2];
	p = "";
	for(int i=0;i<vec.size();i++)
	  p += vec[i];
      }
    return p;
  }
 
  string expression(){
    string p = term();
    while(parse[pos] == '|' || parse[pos] == '&'){
      if(parse[pos] == '|'){p+=parse[pos],pos++;p+=term();}
      else {p+=parse[pos],pos++;p+=term();}
    }
    return p;
  } 

 
 
};

vector<string> split(string parse)
{
  int st = 0;
  vector<string> vec;
  for(int i=0;i<=parse.size();i++)
    {
      if(i == parse.size() || parse[i] == '|' || parse[i] == '&')
	{
	  vec.push_back(parse.substr(st,i-st));
	  if(i != parse.size() && (parse[i] == '|' || parse[i] == '&'))
	    {
	      vec.push_back(parse.substr(i,1));
	    }
	  st = i+1;
	}	
    }
  return vec;
}

void makeIndex(VVS& input)
{
  int cnt = 1;
  for(int i=0;i<input.size();i++)
    {
      string name = (input[i][0][0]=='~')?input[i][0].substr(1,input[i][0].size()-1):input[i][0];
      if(!Index[name])
	{
	  Index[name] = cnt++;
	  Index[("~"+name)] = M+cnt-1;
	}

      if(input[i].size() >= 3)
	{
	  string name = (input[i][2][0]=='~')?input[i][2].substr(1,input[i][2].size()-1):input[i][2];
	  if(!Index[name])
	    {
	      Index[name] = cnt++;
	      Index[("~"+name)] = M+cnt-1;
	    }
	}
    }

  for(map<string,int>::iterator it = Index.begin();it != Index.end();it++)
    (*it).second--;
    
}

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;
}


int main()
{
  string s;
  while(cin >> N >> M)
    {
      for(int i=0;i<MAX_V;i++)
	G[i].clear(),rG[i].clear(),cmp[i] = -1;
      vs.clear();      

      Index.clear();
      VVS input;
      for(int i=0;i<N;i++)
	{
	  cin >> s;
	  Parsing par(s);
	  input.push_back(split(par.expression()));
	}

      makeIndex(input);

      V = Index.size();
    
      for(int i=0;i<input.size();i++)
	{
	  string A,B,rA,rB;
	  if(input[i].size() == 1)
	    {
	      A = input[i][0];
	      rA = (A[0] == '~')?A.substr(1,A.size()-1):("~"+A);
	      B = input[i][0];
	      rB = (B[0] == '~')?B.substr(1,B.size()-1):("~"+B);	     
	    }
	  else if(input[i].size() == 3)
	    {
	      if(input[i][1][0] == '|')
		{
		  A = input[i][0];
		  rA = (A[0] == '~')?A.substr(1,A.size()-1):("~"+A);
		  B = input[i][2];
		  rB = (B[0] == '~')?B.substr(1,B.size()-1):("~"+B);
		}
	      else
		{
		  A = input[i][0];
		  rA = (A[0] == '~')?A.substr(1,A.size()-1):("~"+A);
		  B = input[i][0];
		  rB = (B[0] == '~')?B.substr(1,B.size()-1):("~"+B);	     
		  add_edge(Index[rA],Index[B]);
		  add_edge(Index[rB],Index[A]);
		  A = input[i][2];
		  rA = (A[0] == '~')?A.substr(1,A.size()-1):("~"+A);
		  B = input[i][2];
		  rB = (B[0] == '~')?B.substr(1,B.size()-1):("~"+B);	     
		}	    
	    }
	  else
	    assert(false);
	  add_edge(Index[rA],Index[B]);
	  add_edge(Index[rB],Index[A]);	
	}

      scc();

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

Measured memory_bytes: 1496