#include <bits/stdc++.h>
using namespace std;
vector<int> v[4];
int dp[4][200111];
int e, s, n, m;
int f(int a, int b) {
  int x = lower_bound(v[a].begin(), v[a].end(), b) - v[a].begin();
  return dp[a][x] + max(0, v[a][x] - b - s);
}
int main() {
  scanf("%d%d%d%d", &e, &s, &n, &m);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (b >= e) continue;
    for (int j = 1; j <= a; j++) v[j].push_back(b);
  }
  for (int i = 1; i <= 3; i++) {
    v[i].push_back(e);
    sort(v[i].begin(), v[i].end());
    for (int j = v[i].size() - 1 - 1; j >= 0; j--)
      dp[i][j] = dp[i][j + 1] + max(0, v[i][j + 1] - v[i][j] - s);
  }
  while (m--) {
    int a;
    scanf("%d", &a);
    if (f(1, a) != 0)
      printf("-1 -1\n");
    else
      printf("%d %d\n", f(2, a), f(3, a) - f(2, a));
  }
}
