text: 
  //misaka will carry me to master
  #include <iostream>
  #include <cstdio>
  #include <cstring>
  #include <cmath>
  #include <utility>
  #include <cassert>
  #include <algorithm>
  #include <vector>
  #include <functional>
  #include <numeric>
  #include <set>
  #include <map>
  
  #define ll long long
  #define lb long double
  #define sz(vec) ((int)(vec.size()))
  #define all(x) x.begin(), x.end()
  #define pb push_back
  #define mp make_pair
  
  const lb eps = 1e-9;
  const ll mod = 1e9 + 7, ll_max = 1e18;
  //const ll mod = (1 << (23)) * 119 +1;
  const int MX = 8e5 +10, int_max = 0x3f3f3f3f;
  
  using namespace std;
  
  struct node{
  	int v, e, f;
  	node(){
  		v = 0, e = 0, f = 0;
  	}
  	node(int a, int b, int c){
  		v = a, e = b, f = c;
  	}
  	node operator + (const node& b) const {
  		return node(v + b.v, e + b.e, f + b.f);
  	}
  	node operator - (const node& b) const{
  		return node(v - b.v, e - b.e, f - b.f);
  	}
  };
  
  int root[MX];
  int n, q, s, m;
  
  
  const int NN = MX * 20;
  const node uV = node(1, 0, 0), uE = node(0, 1, 0), uF = node(0, 0, 1);
  
  node sum[NN];
  int lc[NN], rc[NN];
  void dup(int& k){
  	static int ind = 0;
  	ind++;
  	sum[ind] = sum[k];
  	lc[ind] = lc[k];
  	rc[ind] = rc[k];
  	k = ind;
  }
  
  void U(int p, int& k, const node& v, int L, int R){
  	if(R <= p || p < L) return ;
  	dup(k);
  	if(L + 1 == R){
  		assert(L == p);
  		sum[k] = sum[k] + v;
  		return ;
  	}
  	int mid = (L + R)/2;
  	U(p, lc[k], v, L, mid);
  	U(p, rc[k], v, mid, R);
  	sum[k] = sum[lc[k]] + sum[rc[k]];
  }
  
  node Q(int qL, int qR, int k, int L, int R){
  	if((!k) || R <= qL || qR <= L || R <= L) return node();
  	if(qL <= L && R <= qR) return sum[k];
  	int mid = (L + R)/2;
  	return Q(qL, qR, lc[k], L, mid) + Q(qL, qR, rc[k], mid, R);
  }
  
  node Q(int x, int y){
  	if(x < 0 || y < 0) return node();
  	return Q(0, y+1, root[x], 0, s);
  }
  
  node query(int x1, int y1, int x2, int y2){
  	x1--, y1--;
  	return Q(x1, y1) + Q(x2, y2) - Q(x1, y2) - Q(x2, y1);
  }
  
  #define pii pair<int, int>
  set<pii> cand_v, cand_e, cand_f;
  set<pii> is_v, is_e, is_f;
  vector<int> vu[MX], eu[MX], fu[MX]; //funny
  
  char snake[MX];
  
  void cand(){
  	for(const auto& e : cand_v){
  		int x = e.first, y = e.second;
  		//cand_e
  		is_e.insert(mp(x + 1, y));
  		is_e.insert(mp(x - 1, y));
  		is_e.insert(mp(x, y + 1));
  		is_e.insert(mp(x, y - 1));
  		//cand_f
  		is_f.insert(mp(x + 1, y + 1));
  		is_f.insert(mp(x + 1, y - 1));
  		is_f.insert(mp(x - 1, y + 1));
  		is_f.insert(mp(x - 1, y - 1));
  		is_v.insert(e);
  	}
  }
  
  void pr(const pair<int, int>& e){
  	cout << e.first << " " << e.second << "\n";
  }	
  
  void is(){
  	for(const auto& e : is_v){
  		vu[e.first].pb(e.second);	
  	}	
  	for(const auto& e : is_e){
  		eu[e.first].pb(e.second);
  	}
  	for(const auto& e : is_f){
  		fu[e.first].pb(e.second);
  	}
  }
  
  void solve(){
  	int r, c;
  	cin >> r >> c >> m >> q;
  	n = max(r, c);
  	n *= 4;
  	for(s = 1; s<=n; s*=2);
  	int sx, sy;
  	cin >> sx >> sy;
  	if(m) cin >> snake;
  	assert(strlen(snake) == m);
  	cand_v.insert(mp(sx*2, sy*2));
  	for(int i = 0; i<m; i++){
  		char z = snake[i];
  		if(z == 'N'){
  			sx--;
  		}else if(z == 'S'){
  			sx++;
  		}else if(z == 'E'){
  			sy++;
  		}else{
  			sy--;
  		}
  		cand_v.insert(mp(sx*2, sy*2));
  	}
  	cand();
  	is();
  	for(int i = 1; i<=n; i++){
  		root[i] = root[i-1];
  		for(int y : vu[i]){
  			U(y, root[i], uV, 0, s);
  		}
  		for(int y : eu[i]){
  			U(y, root[i], uE, 0, s);
  		}
  		for(int y : fu[i]){
  			U(y, root[i], uF, 0, s);
  		}
  	}
  	while(q--){
  		int x1, y1, x2, y2;
  		cin >> x1 >> y1 >> x2 >> y2;
  		node cur = query(x1*2, y1*2, x2*2, y2*2);
  		ll area = 1ll*(x2+1 - x1) * (y2+1 - y1);
  		ll vcnt = area - cur.v;
  		ll ecnt = (2ll * area - (x2+1 - x1) - (y2+1 - y1)) - cur.e;
  		ll fcnt = 1ll*(x2 - x1)*(y2 -y1) - cur.f;
  		fcnt++; //outside region
  		//check the boundaries
  		x1*=2, y1*=2, x2*=2, y2*=2;
  		if(max({query(x1, y1, x1, y2).v, query(x1, y1, x2, y1).v, query(x2, y1, x2, y2).v, query(x1, y2, x2, y2).v}) == 0 && cur.v != 0) fcnt++; //magic
  		ll cc = vcnt - ecnt + fcnt - 1;
  		cout << cc << "\n";
  	}
  
  }
  
  int main(){
    cin.tie(0) -> sync_with_stdio(0);
  
    int T = 1;
    //cin >> T;
    while(T--){
  		solve();
    }
    return 0;
  }
  
  
  
  