#include <bits/stdc++.h>
using namespace std;
const int QUERY_NO = 100;
const int MAXN = 800111;
vector<pair<int, int> > events;
int count_stns[100];
pair<long long, long long> answers[MAXN];
int main() {
  int e, s, n, m;
  scanf("%d%d%d%d", &e, &s, &n, &m);
  count_stns[0] = 1;
  for (int i = (1); i <= (n); i++) {
    int t, x;
    scanf("%d%d", &t, &x);
    if (x < e) {
      events.emplace_back(x, +t);
      if (x + s >= e) {
        count_stns[t]++;
      } else {
        events.emplace_back(min(x + s, e), -t);
      }
    }
  }
  for (int i = (1); i <= (m); i++) {
    int pos;
    scanf("%d", &pos);
    if (pos < e) {
      events.emplace_back(min(pos + s, e), QUERY_NO + i);
    }
  }
  sort((events).begin(), (events).end());
  int idx = events.size() - 1;
  int last_pos = e;
  long long totalz[5];
  for (int i = (0); i <= (3); i++) totalz[i] = 0LL;
  for (int i = (idx); i >= (0); i--) {
    int pos = events[i].first;
    int val = events[i].second;
    for (int j = (3); j >= (0); j--) {
      if (count_stns[j] > 0) {
        totalz[j] += last_pos - pos;
        break;
      }
    }
    last_pos = pos;
    if (val > QUERY_NO) {
      int query_loc = val - QUERY_NO;
      if (totalz[0] == 0) {
        answers[query_loc] = make_pair(totalz[1], totalz[2]);
      } else {
        answers[query_loc] = make_pair(-1LL, -1LL);
      }
    } else if (val > 0) {
      count_stns[val]--;
    } else {
      count_stns[-val]++;
    }
  }
  for (int i = (1); i <= (m); i++) {
    printf("%lld %lld\n", answers[i].first, answers[i].second);
  }
}
