// Arup Guha
// 6/8/2023
// Solution to Kattis Problem: Verify This, Your Majesty
// https://open.kattis.com/problems/queens

using namespace std;
#include <bits/stdc++.h>

bool solve(vector<int> perm);

int main() {

    // Set permutation.
    int n;
    cin >> n;
    vector<int> perm(n);
    for (int i=0; i<n; i++) perm[i] = -1;

    bool flag = true;

    // Read in queen positions, marking invalid set of rows.
    for (int i=0; i<n; i++) {
        int x, y;
        cin >> x >> y;
        if (perm[x] != -1) flag = false;
        perm[x] = y;
    }

    // Easy case.
    if (!flag)
        cout << "INCORRECT" << endl;

    // Rows are unique. Solve it.
    else {
        bool res = solve(perm);
        if (res) cout << "CORRECT" << endl;
        else cout << "INCORRECT" << endl;
    }
    return 0;
}

// Returns true iff no two queens stored in perm can attack each other.
bool solve(vector<int> perm) {

    int n = perm.size();

    // Loop through all pairs.
    for (int i=0; i<n; i++) {
        for (int j=i+1; j<n; j++) {

            // Same column = bad.
            if (perm[i] == perm[j]) return false;

            // Same diag = bad.
            if ( abs(i-j) == abs(perm[i]-perm[j])) return false;
        }
    }

    // We're good.
    return true;
}
