#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
const int INF = (int)1.01e9;
const long double EPS = 1e-9;
void precalc() {}
int e, s, n, m;
const int maxn = (int)2e5 + 10;
int starts[maxn];
pair<int, int> a[maxn];
bool read() {
  if (scanf("%d%d%d%d", &e, &s, &n, &m) < 4) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &a[i].second, &a[i].first);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", starts + i);
  }
  return 1;
}
int ar1[maxn], ar2[maxn];
int sum1[maxn], sum2[maxn];
void countSums(int n, int *a, int *sum) {
  sum[0] = 0;
  for (int i = 0; i < n; ++i) {
    int touse = s;
    if (i) {
      touse = min(touse, a[i] - a[i - 1]);
    }
    sum[i + 1] = sum[i] + touse;
  }
}
int get(int x, int n, int *a, int *sum) {
  int pos = lower_bound(a, a + n, x) - a;
  assert(pos < n);
  int res = sum[n] - sum[pos + 1];
  res += min(s, a[pos] - x);
  res = max(0, e - x - res);
  return res;
}
void solve() {
  sort(a, a + n);
  int last = e - s;
  for (int i = n - 1; i >= 0; --i) {
    if (a[i].first < last) {
      break;
    }
    last = min(last, a[i].first - s);
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; ++i) {
    if (a[i].first < last || a[i].first >= e) {
      continue;
    }
    if (a[i].second == 3) {
      ar1[cnt1++] = a[i].first;
    }
    if (a[i].second >= 2) {
      ar2[cnt2++] = a[i].first;
    }
  }
  ar1[cnt1++] = e;
  ar2[cnt2++] = e;
  countSums(cnt1, ar1, sum1);
  countSums(cnt2, ar2, sum2);
  for (int iter = 0; iter < m; ++iter) {
    int x = starts[iter];
    if (x < last) {
      printf("-1 -1\n");
      continue;
    }
    int bad = get(x, cnt2, ar2, sum2);
    int norm = get(x, cnt1, ar1, sum1) - bad;
    printf("%d %d\n", bad, norm);
  }
}
int main() {
  srand(rdtsc());
  precalc();
  while (1) {
    if (!read()) {
      break;
    }
    solve();
  }
  return 0;
}
