#include <bits/stdc++.h>

using namespace std;

namespace {
    int M;
    map< string, bitset<256> > V;
    int N;
    vector<string> F;
    void input() {
        cin >> M;
        V.clear();
        for (int i = 0; i < M; i++) {
            string name; int lb, ub;
            cin >> name >> lb >> ub;
            bitset<256> bit(0LL);
            for (int i = lb; i <= ub; i++) bit[i] = true;
            V[name] = bit;
        }
        cin >> N;
        F.clear(); F.resize(N);
        for (int i = 0; i < N; i++) cin >> F[i];
    }

    bool integer(const string& s) {
        return isdigit(s[0]);
    }

    int to_i(const string& s) {
        istringstream is(s);
        int n; is >> n;
        return n;
    }

    typedef bitset<256> B;

    bool check() {
        vector<B> stack;
        for (int i = 0; i < N; i++) {
            if (integer(F[i])) {
                int x = to_i(F[i]);
                B bit(0LL); bit[x] = true;
                stack.push_back(bit);
            } else if (V.count(F[i])) {
                stack.push_back(V[ F[i] ]);
            } else {
                B b = stack.back(); stack.pop_back();
                B a = stack.back(); stack.pop_back();
                B c(0);
                switch (F[i][0]) {
                    case '+':
                        for (int x = 0; x < 256; x++) {
                            for (int y = 0; y < 256; y++) {
                                if (a[x] && b[y]) {
                                    c[(x + y) % 256] = true;
                                }
                            }
                        }
                        stack.push_back(c);
                        break;
                    case '-':
                        for (int x = 0; x < 256; x++) {
                            for (int y = 0; y < 256; y++) {
                                if (a[x] && b[y]) {
                                    c[(x - y + 256) % 256] = true;
                                }
                            }
                        }
                        stack.push_back(c);
                        break;
                    case '*':
                        for (int x = 0; x < 256; x++) {
                            for (int y = 0; y < 256; y++) {
                                if (a[x] && b[y]) {
                                    c[x * y % 256] = true;
                                }
                            }
                        }
                        stack.push_back(c);
                        break;
                    case '/':
                        if (b[0]) return false;
                        for (int x = 0; x < 256; x++) {
                            for (int y = 0; y < 256; y++) {
                                if (a[x] && b[y]) {
                                    c[x / y] = true;
                                }
                            }
                        }
                        stack.push_back(c);
                        break;
                    default: assert(0);
                }
            }
        }
        return true;
    }

    void solve() {
        cout << (check() ? "correct" : "error") << endl;
    }
}

int main() {
    input(); solve();
    return 0;
}

Measured memory_bytes: 1240