#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int en, s, n, m;
pair<int, int> a[300000];
vector<pair<int, int> > c[5];
struct DAT {
  int t1, t2, t3;
  DAT() { t1 = t2 = t3 = 0; }
  DAT(int t1, int t2, int t3) { this->t1 = t1, this->t2 = t2, this->t3 = t3; }
  DAT operator+(const DAT &p) const {
    DAT res;
    if (p.t1 < 0 || t1 < 0) return DAT(-1, -1, -1);
    res.t1 = t1 + p.t1, res.t2 = t2 + p.t2, res.t3 = t3 + p.t3;
    return res;
  }
};
DAT d[300000];
int find(int x, int y, int ty) {
  int idx =
      lower_bound((c[ty]).begin(), (c[ty]).end(), pair<int, int>(x + 1, -1)) -
      c[ty].begin();
  if (idx >= c[ty].size() || c[ty][idx].first > y) return -1;
  return c[ty][idx].second;
}
int find2(int x, int y) {
  int u, v;
  u = find(x, y, 2);
  v = find(x, y, 3);
  if (u < 0) return v;
  if (v < 0) return u;
  return min(u, v);
}
int find3(int x, int y) {
  int u, v;
  u = find2(x, y);
  v = find(x, y, 1);
  if (u < 0) return v;
  if (v < 0) return u;
  return min(u, v);
}
DAT calcf(int x, int y) {
  int u;
  if (a[x].first + y >= en) return DAT();
  if (a[x].first + s >= en) {
    if (a[x].second == 3)
      return DAT(0, 0, en - a[x].first - y);
    else if (a[x].second == 2) {
      if ((u = find(a[x].first, en, 3)) < 0)
        return DAT(0, en - a[x].first - y, 0);
      else
        return DAT(0, max(0, a[u].first - (a[x].first + y)), 0) +
               calcf(u, max(0, y - (a[u].first - a[x].first)));
    } else {
      if ((u = find2(a[x].first, en)) < 0)
        return DAT(en - a[x].first - y, 0, 0);
      else
        return DAT(max(0, a[u].first - (a[x].first + y)), 0, 0) +
               calcf(u, max(0, y - (a[u].first - a[x].first)));
    }
  } else {
    if (a[x].second == 3)
      return DAT(0, 0, s - y) + d[x];
    else if (a[x].second == 2) {
      if ((u = find(a[x].first, a[x].first + s, 3)) < 0)
        return DAT(0, s - y, 0) + d[x];
      else
        return DAT(0, max(0, a[u].first - (a[x].first + y)), 0) +
               calcf(u, max(0, y - (a[u].first - a[x].first)));
    } else {
      if ((u = find2(a[x].first, a[x].first + s)) < 0)
        return DAT(s - y, 0, 0) + d[x];
      else
        return DAT(max(0, a[u].first - (a[x].first + y)), 0, 0) +
               calcf(u, max(0, y - (a[u].first - a[x].first)));
    }
  }
}
void calcd(int x) {
  if (a[x].first + s >= en) return;
  int u;
  if ((u = find3(a[x].first, a[x].first + s)) < 0) {
    d[x] = DAT(-1, -1, -1);
  } else {
    d[x] = calcf(u, s - (a[u].first - a[x].first));
  }
}
int main() {
  int i, j, k;
  cin >> en >> s >> n >> m;
  for (i = 0; i < n; i++) {
    scanf("%d%d", &a[i].second, &a[i].first);
    if (a[i].second >= en) i--, n--;
  }
  sort(a, a + n);
  for (i = 0; i < n; i++)
    c[a[i].second].push_back(pair<int, int>(a[i].first, i));
  for (i = n - 1; i >= 0; i--) {
    calcd(i);
  }
  for (i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    DAT res;
    if (x + s < en) {
      int u;
      if ((u = find3(x - 1, x + s)) < 0)
        res = DAT(-1, -1, -1);
      else
        res = calcf(u, s - (a[u].first - x));
    }
    printf("%d %d\n", res.t1, res.t2);
  }
  return 0;
}
