#include <bits/stdc++.h>
using namespace std;
int n, m, k, t, T, x, y, sum, cnt, ans, e, s;
int f[200005];
int dp[4][200005];
vector<int> gas[4];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  scanf("%d %d %d %d", &e, &s, &n, &m);
  for (int i = (1); i <= (n); i++) {
    scanf("%d %d", &x, &y);
    if (y < e) {
      for (int j = (1); j <= (x); j++) {
        gas[j].push_back(y);
      }
    }
  }
  for (int i = (1); i <= (3); i++) {
    gas[i].push_back(e);
    sort((gas[i]).begin(), (gas[i]).end());
  }
  for (int i = (1); i <= (m); i++) {
    scanf("%d", &f[i]);
  }
  for (int i = (1); i <= (3); i++) {
    int sz = (int)gas[i].size();
    for (int j = (sz - 2); j >= (0); j--) {
      dp[i][j] = dp[i][j + 1] + max(0, gas[i][j + 1] - gas[i][j] - s);
    }
  }
  for (int i = (1); i <= (m); i++) {
    int pos = lower_bound(gas[1].begin(), gas[1].end(), f[i]) - gas[1].begin();
    int one = dp[1][pos] + max(0, gas[1][pos] - f[i] - s);
    if (one > 0) {
      printf("-1 -1\n");
      continue;
    }
    pos = lower_bound(gas[2].begin(), gas[2].end(), f[i]) - gas[2].begin();
    int two = dp[2][pos] + max(0, gas[2][pos] - f[i] - s);
    pos = lower_bound(gas[3].begin(), gas[3].end(), f[i]) - gas[3].begin();
    int three = dp[3][pos] + max(0, gas[3][pos] - f[i] - s);
    printf("%d %d\n", two, three - two);
  }
  return 0;
}
