//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned char uchar;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);


int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int M; cin >> M;
  map<string, pair<uchar,uchar>> var;
  REP(i,M){
	string s; int lb, ub;
	cin >> s >> lb >> ub;
	var[s] = MP(lb,ub);
  }

  int N; cin >> N;
  bool ans = true;
  stack<vector<bool>> s;
  while(N-- && ans){
	if(!s.empty()){/*
	  auto tmp = s.top();
	  cout << "top: ";
	  REP(i,256) if(tmp[i]) cout << i << " ";
	  cout << endl;*/
	}
	
	string term; cin >> term;
	//cout<<term <<endl;
	if('0' <= term[0] && term[0] <= '9'){
	  uchar x = atoi(term.c_str());
	  vector<bool> r(256,false);
	  r[x] = true;
	  s.push(r);
	}
	else if(term == "+"){
	  auto b = s.top(); s.pop();
	  auto a = s.top(); s.pop();
	  vector<bool> r(256, false);
	  for(uchar a_=0;;++a_){
		if(a[a_])
		  for(uchar b_=0;;++b_){
			uchar x = a_+b_;
			if(b[b_]) r[x] = true;
			if(b_ == 255) break;
		  }
		if(a_ == 255) break;
	  }
	  s.push(r);
	}
	else if(term == "-"){
	  auto b = s.top(); s.pop();
	  auto a = s.top(); s.pop();
	  vector<bool> r(256, false);
	  for(uchar a_=0;;++a_){
		if(a[a_])
		  for(uchar b_=0;;++b_){
			uchar x = a_ - b_;
			if(b[b_]) r[x] = true;
			if(b_ == 255) break;
		  }
		if(a_ == 255) break;
	  }
	  s.push(r);
	}
	else if(term == "*"){
	  auto b = s.top(); s.pop();
	  auto a = s.top(); s.pop();
	  vector<bool> r(256, false);
	  for(uchar a_=0;;++a_){
		if(a[a_])
		  for(uchar b_=0;;++b_){
			uchar x = a_*b_;
			if(b[b_]) r[x] = true;
			if(b_ == 255) break;
		  }
		if(a_ == 255) break;
	  }
	  s.push(r);
	}
	else if(term == "/"){
	  auto b = s.top(); s.pop();
	  auto a = s.top(); s.pop();
	  if(b[0]){
		ans = false;
		break;
	  }

	  vector<bool> r(256, false);
	  for(uchar a_=0;;++a_){
		if(a[a_])
		  for(uchar b_=1;;++b_){
			uchar x = a_/b_;
			if(b[b_]) r[x] = true;
			if(b_ == 255) break;
		  }
		if(a_ == 255) break;
	  }
	  s.push(r);
	}
	else{
	  auto p = var[term];
	  vector<bool> r(256,false);
	  for(uchar i=p.first;i<p.second;++i)
		r[i] = true;
	  r[p.second] = true;
	  s.push(r);
	}
  }

  cout << (ans? "correct": "error") << endl;
  
  return 0;
}

Measured memory_bytes: 1248