2021-09-12 13:09:03 +00:00
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
int n, m;
|
2021-09-12 13:11:20 +00:00
|
|
|
map<string, int> m1, m2;
|
2021-09-12 13:09:03 +00:00
|
|
|
string s;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
cin >> n;
|
2021-09-12 13:11:20 +00:00
|
|
|
while (n--) {
|
2021-09-12 13:09:03 +00:00
|
|
|
cin >> s;
|
2021-09-12 13:11:20 +00:00
|
|
|
m1[s]++;
|
2021-09-12 13:09:03 +00:00
|
|
|
}
|
|
|
|
cin >> m;
|
2021-09-12 13:11:20 +00:00
|
|
|
while (m--) {
|
2021-09-12 13:09:03 +00:00
|
|
|
cin >> s;
|
2021-09-12 13:11:20 +00:00
|
|
|
m2[s]++;
|
|
|
|
if (m2[s] > 1) {
|
|
|
|
cout << "REPEAT" << endl;
|
|
|
|
} else if (m1[s]) {
|
|
|
|
cout << "OK" << endl;
|
|
|
|
} else {
|
|
|
|
cout << "WRONG" << endl;
|
2021-09-12 13:09:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|