#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
vector<int> vec[3];
int f[3][maxn], ed, s, m, n;
inline int Get_Ans(int Position, int j) {
  int t = lower_bound(vec[j].begin(), vec[j].end(), Position) - vec[j].begin();
  return f[j][t] + max(0, vec[j][t] - Position - s);
}
int main() {
  scanf("%d%d%d%d", &ed, &s, &n, &m);
  for (int i = 0; i < 3; i++) vec[i].push_back(ed);
  memset(f, 0, sizeof(f));
  int Gas, Position;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &Gas, &Position);
    if (Position > ed) continue;
    for (int j = 0; j < Gas; j++) vec[j].push_back(Position);
  }
  for (int i = 0; i < 3; i++) {
    sort(vec[i].begin(), vec[i].end());
    for (int j = vec[i].size() - 2; j > -1; j--)
      f[i][j] = f[i][j + 1] + max(0, vec[i][j + 1] - vec[i][j] - s);
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &Position);
    int Ans[3];
    for (int j = 0; j < 3; j++) Ans[j] = Get_Ans(Position, j);
    if (Ans[0] > 0)
      printf("-1 -1\n");
    else
      printf("%d %d\n", Ans[1], Ans[2] - Ans[1]);
  }
  return 0;
}
