#include <bits/stdc++.h>
using namespace std;
struct Madoka {
  int x, t;
} s[400010];
bool cmp(Madoka a, Madoka b) { return a.x < b.x; }
int S, N;
bool ok;
int pos[200010];
int tp[200010];
int cnt[4];
void init() {
  N = 1;
  pos[1] = 0;
  tp[1] = 4;
  ok = true;
}
void insert(int x, int t) {
  if (x - pos[N] > S) {
    ok = false;
    return;
  }
  while (tp[N] <= t && x - pos[N - 1] <= S) {
    cnt[tp[N]] -= pos[N] - pos[N - 1];
    N--;
  }
  if (tp[N] <= t) {
    int tpos = x - S;
    cnt[tp[N]] -= pos[N] - tpos;
    pos[N] = tpos;
    cnt[t] += S;
  } else
    cnt[t] += x - pos[N];
  N++;
  pos[N] = x;
  tp[N] = t;
  return;
}
int tcnt[4];
pair<int, int> virt_insert(int x, int t) {
  if (x - pos[N] > S) {
    ok = false;
    return make_pair(0, 0);
  }
  int tN = N;
  for (int i = 0; i < 4; i++) tcnt[i] = cnt[i];
  while (tp[tN] <= t && x - pos[tN - 1] <= S) {
    tcnt[tp[tN]] -= pos[tN] - pos[tN - 1];
    tN--;
  }
  if (tp[tN] <= t) {
    int tpos = x - S;
    tcnt[tp[tN]] -= pos[tN] - tpos;
    tcnt[t] += S;
  } else
    tcnt[t] += x - pos[tN];
  return make_pair(tcnt[1], tcnt[2]);
}
int ansx[200010], ansy[200010];
int main() {
  int e, n, m;
  scanf("%d %d %d %d", &e, &S, &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d %d", &s[i].t, &s[i].x);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &s[n + i].x);
    s[n + i].t = -i;
  }
  sort(s + 1, s + n + m + 1, cmp);
  int E = 0;
  for (int i = 1; i <= n + m; i++)
    if (s[i].x <= e) E = i;
  init();
  for (int i = E; i >= 1; i--)
    if (s[i].t > 0)
      insert(e - s[i].x, s[i].t);
    else {
      pair<int, int> res = virt_insert(e - s[i].x, 3);
      if (!ok)
        ansx[-s[i].t] = ansy[-s[i].t] = -1;
      else
        ansx[-s[i].t] = res.first, ansy[-s[i].t] = res.second;
    }
  init();
  for (int i = E + 1; i <= n + m; i++)
    if (s[i].t > 0)
      insert(s[i].x - e, s[i].t);
    else {
      pair<int, int> res = virt_insert(s[i].x - e, 3);
      if (!ok)
        ansx[-s[i].t] = ansy[-s[i].t] = -1;
      else
        ansx[-s[i].t] = res.first, ansy[-s[i].t] = res.second;
    }
  for (int i = 1; i <= m; i++) printf("%d %d\n", ansx[i], ansy[i]);
  return 0;
}
