#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
using ll = long long;
int e, s, n, m;
vector<int> d[3];
ll dp[3][N];
ll calc(int a, int b) {
  int cur = lower_bound(d[a].begin(), d[a].end(), b) - d[a].begin();
  return dp[a][cur] + max(d[a][cur] - b - s, 0);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> e >> s >> n >> m;
  int t1, t2;
  for (int i = 1; i <= n; i++) {
    cin >> t1 >> t2;
    if (t2 >= e) continue;
    for (int j = 0; j < t1; j++) d[j].push_back(t2);
  }
  for (int i = 0; i < 3; i++) {
    d[i].push_back(e);
    sort(d[i].begin(), d[i].end());
    for (int j = d[i].size() - 2; j >= 0; --j)
      dp[i][j] = dp[i][j + 1] + max(d[i][j + 1] - d[i][j] - s, 0);
  }
  for (int i = 1; i <= m; i++) {
    int sd;
    cin >> sd;
    if (calc(0, sd))
      puts("-1 -1");
    else
      printf("%lld %lld\n", calc(1, sd), calc(2, sd) - calc(1, sd));
  }
  return 0;
}
