#include <bits/stdc++.h>
using namespace std;
vector<int> g[3];
int f[3][200005];
int e, s, n, m;
int cal(int type, int pos) {
  int index =
      lower_bound(g[type].begin(), g[type].end(), pos) - g[type].begin();
  return f[type][index] + max(g[type][index] - pos - s, 0);
}
int main() {
  scanf("%d%d%d%d", &e, &s, &n, &m);
  for (int i = 0; i < n; i++) {
    int t, x;
    scanf("%d%d", &t, &x);
    if (x > e) continue;
    for (int j = 0; j < t; j++) g[j].push_back(x);
  }
  for (int i = 0; i < 3; i++) {
    g[i].push_back(e);
    sort(g[i].begin(), g[i].end());
    for (int j = g[i].size() - 2; j >= 0; j--) {
      f[i][j] = f[i][j + 1] + max(g[i][j + 1] - g[i][j] - s, 0);
    }
  }
  for (int i = 0; i < m; i++) {
    int pos;
    scanf("%d", &pos);
    if (cal(0, pos))
      printf("-1 -1\n");
    else {
      int tmp = cal(1, pos);
      printf("%d %d\n", tmp, cal(2, pos) - tmp);
    }
  }
  return 0;
}
