#include <bits/stdc++.h>
const int MAXN = 200000 + 1;
std::vector<int> superGas, nonRegularGas, allGas;
int usedSuperGas[MAXN], usedNonRegularGas[MAXN];
int main(int argc, char *agrv[]) {
  int e, s, n, m;
  scanf("%d %d %d %d", &e, &s, &n, &m);
  for (int i = 1; i <= n + 1; i++) {
    int t, x;
    if (i == n + 1)
      t = 3, x = e;
    else {
      scanf("%d %d", &t, &x);
      if (x >= e) continue;
    }
    if (t == 3) superGas.push_back(x);
    if (t >= 2) nonRegularGas.push_back(x);
    allGas.push_back(x);
  }
  std::sort(superGas.begin(), superGas.end());
  std::sort(nonRegularGas.begin(), nonRegularGas.end());
  std::sort(allGas.begin(), allGas.end());
  int i, limit;
  for (i = allGas.size() - 2; i >= 0; i--) {
    if (allGas[i + 1] - allGas[i] > s) {
      limit = allGas[i + 1] - s;
      break;
    }
  }
  if (i == -1) limit = allGas[0] - s;
  usedSuperGas[superGas.size() - 1] = 0;
  usedNonRegularGas[nonRegularGas.size() - 1] = 0;
  for (int i = superGas.size() - 2; i >= 0; i--)
    usedSuperGas[i] =
        usedSuperGas[i + 1] + std::max(superGas[i + 1] - superGas[i] - s, 0);
  for (int i = nonRegularGas.size() - 2; i >= 0; i--)
    usedNonRegularGas[i] =
        usedNonRegularGas[i + 1] +
        std::max(nonRegularGas[i + 1] - nonRegularGas[i] - s, 0);
  while (m--) {
    int f;
    scanf("%d", &f);
    if (f < limit)
      puts("-1 -1");
    else {
      int loc, ans1, ans2, ans3;
      loc = std::lower_bound(superGas.begin(), superGas.end(), f) -
            superGas.begin();
      ans2 = usedSuperGas[loc] + std::max(superGas[loc] - f - s, 0);
      ans3 = (e - f) - ans2;
      loc = std::lower_bound(nonRegularGas.begin(), nonRegularGas.end(), f) -
            nonRegularGas.begin();
      ans1 = usedNonRegularGas[loc] + std::max(nonRegularGas[loc] - f - s, 0);
      ans2 -= ans1;
      printf("%d %d\n", ans1, ans2);
    }
  }
  return 0;
}
