#include <iostream>
#include <string>
#include <stack>
#include <map>
#include <utility>
#include <bitset>
#include <cctype>

using namespace std;
typedef pair<int, int> pii;
typedef bitset<256> bs256;

bool is_number(const string &s){
	for(int i = 0; i < s.size(); ++i){
		if(!isdigit(s[i])){ return false; }
	}
	return true;
}
int to_number(const string &s){
	unsigned int x = 0;
	for(int i = 0; i < s.size(); ++i){ x = (x * 10) + (s[i] - '0'); }
	return x & 0xff;
}

map<string, pii> range;

int main(){
	int m;
	cin >> m;
	for(int i = 0; i < m; ++i){
		string name;
		int lower, upper;
		cin >> name >> lower >> upper;
		range[name] = pii(lower, upper);
	}
	int n;
	cin >> n;
	stack<bs256> stk;
	bool answer = true;
	for(int i = 0; i < n; ++i){
		string s;
		cin >> s;
		if(is_number(s)){
			bs256 bs;
			bs[to_number(s)] = true;
			stk.push(bs);
		}else if(range.find(s) != range.end()){
			pii p = range[s];
			bs256 bs;
			for(int i = p.first; i <= p.second; ++i){ bs[i] = true; }
			stk.push(bs);
		}else{
			bs256 b = stk.top(); stk.pop();
			bs256 a = stk.top(); stk.pop();
			if(s == "/" && b[0]){ answer = false; break; }
			bs256 c;
			for(int j = 0; j < 256; ++j){
				if(!a[j]){ continue; }
				for(int k = 0; k < 256; ++k){
					if(!b[k]){ continue; }
					int x = 0;
					if(s == "+"){
						x = (j + k) & 0xff;
					}else if(s == "-"){
						x = (j - k) & 0xff;
					}else if(s == "*"){
						x = (j * k) & 0xff;
					}else if(s == "/"){
						x = (j / k) & 0xff;
					}
					c[x] = true;
				}
			}
			stk.push(c);
		}
	}
	cout << (answer ? "correct" : "error") << endl;
	return 0;
}