#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <stack>
#include <map>
#define llint long long
#define inf 1e18

using namespace std;
typedef pair<llint, llint> P;

struct A{
	bool a[256];
	A(){
		for(int i = 0; i < 256; i++) a[i] = false;
	}
	A(llint x){
		for(int i = 0; i < 256; i++) a[i] = false;
		a[x] = true;
	}
};

llint m, n;
map<string, P> mp;
stack<A> stk;

A add(A a, A b)
{
	A ret;
	for(int i = 0; i < 256; i++){
		for(int j = 0; j < 256; j++){
			if(a.a[i] && b.a[j]) ret.a[(i+j)%256] = true;
		}
	}
	return ret;
}
A sub(A a, A b)
{
	A ret;
	for(int i = 0; i < 256; i++){
		for(int j = 0; j < 256; j++){
			if(a.a[i] && b.a[j]) ret.a[(i-j+256)%256] = true;
		}
	}
	return ret;
}
A mul(A a, A b)
{
	A ret;
	for(int i = 0; i < 256; i++){
		for(int j = 0; j < 256; j++){
			if(a.a[i] && b.a[j]) ret.a[(i*j)%256] = true;
		}
	}
	return ret;
}
A divi(A a, A b)
{
	A ret;
	for(int i = 0; i < 256; i++){
		for(int j = 0; j < 256; j++){
			if(a.a[i] && b.a[j]) ret.a[(i/j)%256] = true;
		}
	}
	return ret;
}

int main(void)
{
	cin >> m;
	llint lb, ub; string s;
	for(int i = 1; i <= m; i++){
		cin >> s >> lb >> ub;
		mp[s] = P(lb, ub);
	}
	
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> s;
		//cout << s << endl;
		if(s == "+"){
			A b = stk.top(); stk.pop();
			A a = stk.top(); stk.pop();
			stk.push(add(a, b));
		}
		else if(s == "-"){
			A b = stk.top(); stk.pop();
			A a = stk.top(); stk.pop();
			stk.push(sub(a, b));
		}
		else if(s == "*"){
			A b = stk.top(); stk.pop();
			A a = stk.top(); stk.pop();
			stk.push(mul(a, b));
		}
		else if(s == "/"){
			A b = stk.top(); stk.pop();
			A a = stk.top(); stk.pop();
			if(b.a[0]){
				cout << "error" << endl;
				return 0;
			}
			stk.push(divi(a, b));
		}
		else if(s[0] >= '0' && s[0] <= '9'){
			llint x = atoi(s.c_str());
			stk.push(A(x % 256));
		}
		else{
			llint lb = mp[s].first, ub = mp[s].second;
			A a;
			for(int j = lb; j <= ub; j++) a.a[j] = true;
			stk.push(a);
		}
	}
	cout << "correct" << endl;
	
	return 0;
}
