#include <bits/stdc++.h>
using namespace std;

const int H = 111;
const int W = 111;
const int MAXT = 1111;
const int dx[] = {1,0,-1,0};
const int dy[] = {0,1,0,-1};

int sx, sy, T;
int G[H][W];
int record[MAXT];
bool vis[2][H][W][4];

void show(int w, int h) {
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      cout << G[i][j];
    }
    cout << endl;
  }
}

int main() {
  while (1) {
    { // input
      int n, t;
      if (cin >> n >> sx >> sy >> t); else break;
      ++sx; ++sy;
      sx *= 2; sy *= 2;
      memset(G, 0, sizeof(G));
      while (n--) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        ++a; ++b; ++c; ++d;
        a *= 2; b *= 2; c *= 2; d *= 2;
        for (int y = min(b, d); a == c && y <= max(b, d); ++y)
          G[y][a] += 1;
        for (int x = min(a, c); b == d && x <= max(a, c); ++x)
          G[b][x] += 1;
      }
      memset(record, -1, sizeof(record));
      T = 0;
      for (int i = 0; i < t; ++i) {
        int d, dir;
        char c;
        cin >> d >> c;
        T += d;
        if (c == 'E') dir = 0;
        if (c == 'N') dir = 1;
        if (c == 'W') dir = 2;
        if (c == 'S') dir = 3;
        record[T] = dir;
      }
    }

    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < 4; ++i) 
      vis[0][sy][sx][i] = true;

    for (int i = 0; i < T; ++i) {
      const int now = i & 1;
      const int next = 1 - now;
      memset(vis[next], 0, sizeof(vis[next]));
      for (int y = 0; y < H; ++y) {
        for (int x = 0; x < W; ++x) {
          for (int nd = 0; nd < 4; ++nd) {
            if (!vis[now][y][x][nd]) continue;
            int nx = x, ny = y;
            nx += dx[nd];
            ny += dy[nd];
            if (!G[ny][nx]) continue;
            nx += dx[nd];
            ny += dy[nd];
            if (!G[ny][nx]) continue;
            for (int nnd = 0; nnd < 4; ++nnd) {
              if ((nnd + 2) % 4 == nd) continue;
              if (record[i+1] != -1 &&
                  nd != record[i+1] &&
                  nnd != record[i+1]) continue;
              int nnx = nx;
              int nny = ny;
              nnx += dx[nnd];
              nny += dy[nnd];
              if (!G[nny][nnx]) continue;
              nnx += dx[nnd];
              nny += dy[nnd];
              if (!G[nny][nnx]) continue;
              vis[next][ny][nx][nnd] = true;
            }
          }
        }
      }
    }

    for (int x = 0; x < W; ++x) {
      for (int y = 0; y < H; ++y) {
        bool ok = false;
        for (int nd = 0; nd < 4; ++nd) {
          if (vis[T&1][y][x][nd]) ok = true;
        }
        if (ok) {
          cout << x/2-1 << " " << y/2-1 << endl;
        }
      }
    }
  }
  return 0;
}