#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
bool Finish_read;
template <class T>
inline void read(T &x) {
  Finish_read = 0;
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    if (ch == EOF) return;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x *= f;
  Finish_read = 1;
}
template <class T>
inline void print(T x) {
  if (x / 10 != 0) print(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
inline void writeln(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
  putchar('\n');
}
template <class T>
inline void write(T x) {
  if (x < 0) putchar('-');
  x = abs(x);
  print(x);
}
const int maxn = 100005, maxnode = 16600005;
int mx, my, mz, n, m, k, lx, rx, ly, ry, lz, rz, cnt, lc[maxnode], rc[maxnode],
    lv[maxnode], rv[maxnode], rt[maxn << 2];
inline bool Open(int x, int y, int z) {
  return lx <= x && x <= rx && ly <= y && y <= ry && lz <= z && z <= rz;
}
inline void update(int &o, int l, int r, int y, int z) {
  if (!o) o = ++cnt, rv[o] = mz + 1;
  if (lz <= z) rv[o] = min(rv[o], z);
  if (z <= rz) lv[o] = max(lv[o], z);
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (y <= mid)
    update(lc[o], l, mid, y, z);
  else
    update(rc[o], mid + 1, r, y, z);
}
inline void modify(int o, int l, int r, int x, int y, int z) {
  update(rt[o], 1, my, y, z);
  if (l == r) return;
  int mid = (l + r) >> 1;
  if (x <= mid)
    modify(o << 1, l, mid, x, y, z);
  else
    modify(o << 1 | 1, mid + 1, r, x, y, z);
}
inline bool getans(int o, int l, int r, int yl, int yr, int zl, int zr) {
  if (!o) return 1;
  if (yl <= l && r <= yr) return lv[o] < zl && zr < rv[o];
  bool res = 1;
  int mid = (l + r) >> 1;
  if (yl <= mid) res &= getans(lc[o], l, mid, yl, yr, zl, zr);
  if (yr > mid) res &= getans(rc[o], mid + 1, r, yl, yr, zl, zr);
  return res;
}
inline bool query(int o, int l, int r, int xl, int xr, int yl, int yr, int zl,
                  int zr) {
  if (xl <= l && r <= xr) return getans(rt[o], 1, my, yl, yr, zl, zr);
  bool res = 1;
  int mid = (l + r) >> 1;
  if (xl <= mid) res &= query(o << 1, l, mid, xl, xr, yl, yr, zl, zr);
  if (xr > mid) res &= query(o << 1 | 1, mid + 1, r, xl, xr, yl, yr, zl, zr);
  return res;
}
inline void solve(int x, int y, int z) {
  if (Open(x, y, z)) return (void)puts("OPEN");
  if (query(1, 1, mx, min(lx, x), max(rx, x), min(ly, y), max(ry, y),
            min(lz, z), max(rz, z)))
    return (void)puts("UNKNOWN");
  return (void)puts("CLOSED");
}
int main() {
  read(mx), read(my), read(mz), read(n), read(m), read(k);
  lx = mx, ly = my, lz = mz;
  for (int i = 1, x, y, z; i <= n; ++i) {
    read(x), read(y), read(z);
    lx = min(lx, x), rx = max(rx, x);
    ly = min(ly, y), ry = max(ry, y);
    lz = min(lz, z), rz = max(rz, z);
  }
  for (int i = 1, x, y, z; i <= m; ++i) {
    read(x), read(y), read(z);
    if (Open(x, y, z)) return 0 * puts("INCORRECT");
    modify(1, 1, mx, x, y, z);
  }
  puts("CORRECT");
  for (int i = 1, x, y, z; i <= k; ++i)
    read(x), read(y), read(z), solve(x, y, z);
}
