#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
vector<int> a[4], dp[4];
map<int, int> d;
int e, s;
int solve(int t, int first) {
  int ret = lower_bound(a[t].begin(), a[t].end(), first) - a[t].begin();
  return dp[t][ret] + max(0, a[t][ret] - first - s);
}
int main() {
  int n, m, i, j, t, first;
  cin >> e >> s >> n >> m;
  for (i = 0; i < n; ++i) {
    scanf("%d%d", &t, &first);
    if (first >= e) continue;
    for (j = 1; j <= t; ++j) a[j].push_back(first);
  }
  for (i = 1; i <= 3; ++i) {
    a[i].push_back(e), sort(a[i].begin(), a[i].end()),
        dp[i].resize(a[i].size());
    dp[i].back() = 0;
    for (j = a[i].size() - 2; j >= 0; --j)
      dp[i][j] = dp[i][j + 1] + max(0, a[i][j + 1] - a[i][j] - s);
  }
  int u, v, k;
  for (i = 0; i < m; ++i) {
    scanf("%d", &first);
    u = solve(1, first), v = solve(2, first), k = solve(3, first);
    if (u != 0) {
      printf("-1 -1\n");
      continue;
    }
    printf("%d %d\n", v, k - v);
  }
}
