#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <climits>
#include <cassert>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

#define F first
#define S second
typedef vector<bool> vb;

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v; return v;
}

int main()
{
	map<string, pii> table;
	int m; cin >> m;
	REP(_, m) {
		string name;
		int lb, ub;
		cin >> name >> lb >> ub;
		table[name] = make_pair(lb, ub);
	}
	stack<vb> stack;
	int n; cin >> n;
	REP(_, n) {
		string input; cin >> input;
		vb term(256, false);
		if('0' <= input[0] && input[0] <= '9') {
			int val = toInt(input);
			term[val % 256] = true;
			stack.push(term);
		} else {
			vb a, b;
			switch(input[0]) {
				case '+':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								term[(i + j) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				case '-':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								term[(i - j + 256) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				case '*':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								term[(i * j) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				case '/':
					b = stack.top(); stack.pop(); a = stack.top(); stack.pop();
					REP(i, 256) {
						REP(j, 256) {
							if (a[i] && b[j]) {
								if (j == 0) goto ERROR;
								term[(i / j) % 256] = true;
							}
						}
					}
					stack.push(term);
					break;
				default:
					FOR(i, table[input].F, table[input].S + 1) {
						term[i] = true;
					}
					stack.push(term);
					break;
			}
		}
	}
	cout << "correct" << endl;
	return 0;
ERROR:
	cout << "error" << endl;
	return 0;
}