#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int x[N], t[N];
int e, s, n, m;
vector<int> v[4];
vector<int> len[4];
int get(int type, int x) {
  int i =
      (int)(lower_bound(v[type].begin(), v[type].end(), x) - v[type].begin());
  return len[type][i] + max(0, v[type][i] - x - s);
}
int main() {
  scanf("%d%d%d%d", &e, &s, &n, &m);
  for (int i = (0); i < (n); i++) {
    scanf("%d%d", t + i, x + i);
    if (x[i] >= e) continue;
    for (int j = 1; j <= t[i]; j++) v[j].push_back(x[i]);
  }
  for (int type = 1; type <= 3; type++) {
    v[type].push_back(e);
    sort(v[type].begin(), v[type].end());
    v[type].resize(
        distance(v[type].begin(), unique(v[type].begin(), v[type].end())));
    len[type].resize(int((v[type]).size()));
    for (int i = int((v[type]).size()) - 2; i >= 0; i--)
      len[type][i] = len[type][i + 1] + max(0, v[type][i + 1] - v[type][i] - s);
  }
  for (int i = (0); i < (m); i++) {
    int f;
    scanf("%d", &f);
    int a1 = get(1, f);
    int a2 = get(2, f);
    int a3 = get(3, f);
    if (a1 > 0) {
      printf("-1 -1\n");
    } else {
      printf("%d %d\n", a2, a3 - a2);
    }
  }
  return 0;
}
