#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<set>
#include<map>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

const int N = 105;
const int M = 211;
const int W = 211;

int n,stx,sty,m;
int a[N],b[N],c[N],d[N];
int e[M];
char f[M];
bool input(){
	cin>>n>>stx>>sty>>m;
	rep(i,n)cin>>a[i]>>b[i]>>c[i]>>d[i];
	rep(i,m)cin>>e[i]>>f[i];
	return true;
}

typedef pair<int,int> pii;

void makeinput(){
	rep(i,n){
		a[i]*=2;
		b[i]*=2;
		c[i]*=2;
		d[i]*=2;
	}
	stx*=2;
	sty*=2;
	int sum = 0;
	rep(i,m){
		e[i]*=2;
		sum += e[i];
		e[i] = sum;
	}
}

int board[W][W];
void makeboard(){
	rep(i,W)rep(j,W)board[i][j]=1;
	rep(i,n){
		if(a[i]==c[i])reps(j,min(b[i],d[i]),max(b[i],d[i])+1)board[j][a[i]]=0;
		else reps(j,min(a[i],c[i]),max(a[i],c[i])+1)board[b[i]][j]=0;
	}
}

int dirnum(char c){
	if(c=='N')return 0;
	if(c=='E')return 1;
	if(c=='S')return 2;
	return 3;
}

int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

int dp[2][W][W][4];

bool canmove(int x,int y,int dir,int next){
	if((dir+2)%4==next)return false;
	if(board[y][x]==1)return false;
	
	int nx = x+dx[next];
	int ny = y+dy[next];
	
	if(nx<0 || ny<0 || nx>=W || ny>=W || board[ny][nx]==1)return false;
	
	return true;
}

vector<pii> solve(){
	
	makeinput();
	makeboard();
	
	rep(k,2)rep(i,W)rep(j,W)rep(p,4)dp[k][i][j][p]=0;
	
	int dp1 = 0;
	int dp2 = 1;
	
	rep(i,4)dp[dp1][sty][stx][i]=1;
	
	rep(walk, e[m-1]+1){
		rep(i,W)rep(j,W)rep(k,4)dp[dp2][i][j][k]=0;
		
		int hitnum = -1;
		rep(p, m){
			if(e[p]==walk){
				hitnum = p;
			}
		}
		
		rep(i,W){
			rep(j,W){
				rep(k,4){
					if(dp[dp1][i][j][k]==0)continue;
					rep(p,4){
						bool hitok = true;
						if(hitnum!=-1){
							if(k!=dirnum(f[hitnum]) && p!=dirnum(f[hitnum]))hitok=false;
						}
						if(canmove(j,i,k,p) && hitok){
							int ny = i+dy[p];
							int nx = j+dx[p];
							dp[dp2][ny][nx][p] = 1;
						}
					}
				}
			}
		}
		swap(dp1,dp2);
	}
	
	vector<pii> ret;
	rep(i,W){
		rep(j,W){
			bool ok = false;
			if(dp[dp2][i][j][dirnum(f[m-1])]==1)ok=true;
			rep(k,4){
				if(dp[dp2][i][j][k]==1 && canmove(j,i,k,dirnum(f[m-1])) )ok=true;
			}
			if(ok)ret.push_back(pii(j/2, i/2));
		}
	}
	sort(ret.begin(),ret.end());
	return ret;
}

void call(){
	vector<pii> ans = solve();
	rep(i,ans.size())printf("%d %d\n",ans[i].first, ans[i].second);
}

int main(){
	input();
	call();
}