#include <algorithm>
#include <iostream>
#include <map>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <queue>
#include <set>
#include <stack>
using namespace std;

struct Number{
  vector<int> cand;
  Number(int s, int e){
    for(int i = s; i <= e; i++)
      cand.push_back(i);
  }
  Number(int n){
    cand.push_back(n);
  }
  Number(){}
};

Number operator + (const Number &lhs, const Number &rhs){
  Number ret;
  REP(i,lhs.cand.size()) REP(j,rhs.cand.size()){
    ret.cand.push_back((lhs.cand[i] + rhs.cand[j]) % 256);
    sort(ret.cand.begin(), ret.cand.end());
    ret.cand.erase(unique(ret.cand.begin(), ret.cand.end()), ret.cand.end());
  }
  return ret;
}

Number operator - (const Number &lhs, const Number &rhs){
  Number ret;
  REP(i,lhs.cand.size()) REP(j,rhs.cand.size()){
    ret.cand.push_back((lhs.cand[i] - rhs.cand[j] + 256) % 256);
    sort(ret.cand.begin(), ret.cand.end());
    ret.cand.erase(unique(ret.cand.begin(), ret.cand.end()), ret.cand.end());
  }
  return ret;
}

Number operator * (const Number &lhs, const Number &rhs){
  Number ret;
  REP(i,lhs.cand.size()) REP(j,rhs.cand.size()){
    ret.cand.push_back((lhs.cand[i] * rhs.cand[j]) % 256);
    sort(ret.cand.begin(), ret.cand.end());
    ret.cand.erase(unique(ret.cand.begin(), ret.cand.end()), ret.cand.end());
  }
  return ret;
}

Number operator / (const Number &lhs, const Number &rhs){
  Number ret;
  REP(i,lhs.cand.size()) REP(j,rhs.cand.size()){
    if(rhs.cand[j] == 0) throw 0;
    ret.cand.push_back((lhs.cand[i] / rhs.cand[j]) % 256);
    sort(ret.cand.begin(), ret.cand.end());
    ret.cand.erase(unique(ret.cand.begin(), ret.cand.end()), ret.cand.end());
  }
  return ret;
}

int main(){
  stack<Number> st;
  const int m = getInt();
  map<string, Number> v;

  REP(i,m){
    char buff[256];
    int lb, ub;
    scanf("%s%d%d", buff, &lb, &ub);
    v[buff] = Number(lb, ub);
  }

  const int n = getInt();

  try{
    REP(i,n){
      char buff[256];
      scanf("%s", buff);
      if(v.count(buff)){
        st.push(v[buff]);
      }else if(!isdigit(*buff)){
        const Number rhs = st.top(); st.pop();
        const Number lhs = st.top(); st.pop();
        switch(*buff){
        case '+': st.push(lhs + rhs); break;
        case '-': st.push(lhs - rhs); break;
        case '*': st.push(lhs * rhs); break;
        case '/': st.push(lhs / rhs); break;
        }
      }else{
        int d; sscanf(buff, "%d", &d);
        st.push(d);
      }
    }
    puts("correct");
  }catch(int e){
    puts("error");
  }

  return 0;
}