// Arup Guha
// 6/21/2023
// Solution to SIUCF CP Final Contest Problem: Forced Choice
// https://open.kattis.com/problems/forcedchoice

using namespace std;
#include <bits/stdc++.h>

int main() {
    int n, sec, turns;
    cin >> n >> sec >> turns;

    // Process turns.
    for (int i=0; i<turns; i++) {

        // Get # cards.
        int nC, tmp;
        bool found = false;
        cin >> nC;

        // Process cards, just look for sec.
        for (int j=0; j<nC; j++) {
            cin >> tmp;
            if (tmp == sec) found = true;
        }

        // Ta da!
        if (found)  cout << "KEEP" << endl;
        else        cout << "REMOVE" << endl;
    }

    return 0;
}
