#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
vector<int> D[3];
int E, S, N, M;
long long F[3][MAXN];
int Calc(int Ord, int Side) {
  int Now = lower_bound(D[Ord].begin(), D[Ord].end(), Side) - D[Ord].begin();
  return F[Ord][Now] + max(D[Ord][Now] - Side - S, 0);
}
int main() {
  scanf("%d%d%d%d", &E, &S, &N, &M);
  for (int i = 1; i <= N; i++) {
    int t, x;
    scanf("%d%d", &t, &x);
    if (x >= E) continue;
    for (int j = 0; j < t; j++) D[j].push_back(x);
  }
  for (int i = 0; i < 3; i++) {
    D[i].push_back(E);
    sort(D[i].begin(), D[i].end());
    int Size = D[i].size() - 1;
    for (int j = Size - 1; j >= 0; j--)
      F[i][j] = F[i][j + 1] + max(D[i][j + 1] - D[i][j] - S, 0);
  }
  for (int i = 1; i <= M; i++) {
    int Side;
    scanf("%d", &Side);
    if (Calc(0, Side))
      printf("-1 -1\n");
    else
      printf("%d %d\n", Calc(1, Side), Calc(2, Side) - Calc(1, Side));
  }
}
