import scala.io.StdIn._
object Main extends App {

  val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
  val conditions = Array.fill(n){
    Condition.parse(readLine.trim)
  }
  val variableToInt = conditions.flatMap{
    case s: SingleVariable ⇒ List(s.variable)
    case d: DoubleVariable ⇒ List(d.first, d.second)
  }.distinct.zipWithIndex.toMap
  val uft = new UnionFind(m * 2 + 1)
  for (c ← conditions) {
    c match {
      case s: SingleVariable ⇒
        val idx = variableToInt(s.variable)
        for ((i, b) ← List((idx * 2 + 1, true), (idx * 2, false)) if !s.evaluate(b)) {
          uft.unite(i, m * 2)
        }
      case d: DoubleVariable if d.first == d.second ⇒
        val idx = variableToInt(d.first)
        for ((i, b) ← List((idx * 2 + 1, true), (idx * 2, false)) if !d.evaluate(b, b)) {
          uft.unite(i, m * 2)
        }
      case d: DoubleVariable ⇒
        val left = variableToInt(d.first)
        val right = variableToInt(d.second)
        val forLeft = List((left * 2 + 1, true), (left * 2, false))
        val forRight = List((right * 2 + 1, true), (right * 2, false))
        val invalid = forLeft.flatMap{
          case (l, lb) ⇒ forRight.filter{case (_, rb) ⇒ !d.evaluate(lb, rb)}.map{case (r, _) ⇒ (l, r)}
        }
        if (invalid.size == 1) {
          invalid.foreach{case (l, r) ⇒ uft.unite(l, r)}
        }else {
          forLeft.filter{case (_, lb) ⇒ forRight.forall{case (_, rb) ⇒ !d.evaluate(lb, rb)}}.foreach{case (l, _) ⇒ uft.unite(l, 2 * m)}
          forRight.filter{case (_, rb) ⇒ forLeft.forall{case (_, lb) ⇒ !d.evaluate(lb, rb)}}.foreach{case (r, _) ⇒ uft.unite(r, 2 * m)}
        }
    }
  }
  println{
    if ((0 until m).exists(i ⇒ uft.same(i * 2, i * 2 + 1))) "reject" else "accept"
  }
  class UnionFind(size: Int) {
    private val parent = Array.fill(size){-1}
    def find(a: Int): Int = {
      if (parent(a) < 0) a
      else {
        parent(a) = find(parent(a))
        parent(a)
      }
    }
    def same(a: Int, b: Int): Boolean = find(a) == find(b)
    def unite(a: Int, b: Int): Unit = {
      val ar = find(a)
      val br = find(b)
      if (ar != br) {
        if (parent(ar) < parent(br)) {
          parent(ar) += parent(br)
          parent(br) = ar
        }else {
          parent(br) += parent(ar)
          parent(ar) = br
        }
      }
    }
  }
}
sealed trait Condition
case class SingleVariable(val variable: String, val evaluate: Boolean ⇒ Boolean) extends Condition
case class DoubleVariable(val first: String, val second: String, val evaluate: (Boolean, Boolean) ⇒ Boolean) extends Condition
object Condition {
  def parse(expression: String): Condition = {
    expression.dropRight(1).toList match {
      case e Expression Nil ⇒
        e match {
          case v: VariableCondition ⇒ SingleVariable(v.name, v)
          case o: BiOperator ⇒ DoubleVariable(o.left.name, o.right.name, o)
        }
    }
  }
  private object Name {
    def unapply(arg: List[Char]): Option[(String, List[Char])] = {
      arg.span(_.isLetter) match {
        case (Nil, _) ⇒ None
        case (name, rest) ⇒ Some(name.mkString, rest)
      }
    }
  }
  private object Term {
    def unapply(arg: List[Char]): Option[(InnerCondition, List[Char])] = {
        arg match {
          case '~'::(term Term rest) ⇒ Some(Not(term), rest)
          case '('::Expression(e, ')'::rest) ⇒ Some(e, rest)
          case name Name rest ⇒ Some(Variable(name), rest)
          case _ ⇒ None
        }
    }
  }
  private object Expression {
    def unapply(arg: List[Char]): Option[(InnerCondition, List[Char])] = {
      arg match {
        case term Term rest ⇒
          term match {
            case left: VariableCondition ⇒
              rest match {
                case '&'::Expression(right: VariableCondition, r) ⇒ Some(And(left, right), r)
                case '|'::Expression(right: VariableCondition, r) ⇒Some(Or(left, right), r)
                case _ ⇒ Some(left, rest)
              }
            case _ ⇒ Some(term, rest)
          }
      }
    }
  }
  private sealed trait InnerCondition
  private sealed trait VariableCondition extends InnerCondition with (Boolean ⇒ Boolean) {
    val name: String
    def unary_! : VariableCondition
  }
  private case class Variable(override val name: String) extends VariableCondition {
    override def unary_! : VariableCondition = NotVariable(name)
    override def apply(v1: Boolean): Boolean = v1
  }
  private case class NotVariable(override val name: String) extends VariableCondition {
    override def unary_! : VariableCondition = Variable(name)
    override def apply(v1: Boolean): Boolean = !v1
  }
  private sealed trait BiOperator extends InnerCondition with ((Boolean, Boolean) ⇒ Boolean) {
    val left: VariableCondition
    val right: VariableCondition
  }
  private case class And(override val left: VariableCondition, override val right: VariableCondition) extends BiOperator {
    override def apply(v1: Boolean, v2: Boolean): Boolean = left(v1) && right(v2)
  }
  private case class Or(override val left: VariableCondition, override val right: VariableCondition) extends BiOperator {
    override def apply(v1: Boolean, v2: Boolean): Boolean = left(v1) || right(v2)
  }
  private[this] def Not(condition: InnerCondition): InnerCondition = {
    condition match {
      case Variable(name) ⇒ NotVariable(name)
      case NotVariable(name) ⇒ Variable(name)
      case And(left, right) ⇒ Or(!left, !right)
      case Or(left, right) ⇒ And(!left, !right)
    }
  }
}


Measured memory_bytes: 53384