#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long e, s, m, n;
  cin >> e >> s >> n >> m;
  set<long long> xx[4];
  while (n--) {
    long long t, x;
    cin >> t >> x;
    for (long long j = 1; j <= t; j++) xx[j].insert(x);
  }
  xx[3].insert(e);
  xx[2].insert(e);
  xx[1].insert(e);
  map<pair<long long, long long>, pair<long long, long long>> M;
  function<pair<long long, long long>(long long, long long)> kuro =
      [&](long long f, long long k) -> pair<long long, long long> {
    if (M.count(make_pair(f, k))) return M[make_pair(f, k)];
    if (f >= e) return {0, 0};
    if (xx[3].count(f)) {
      long long f1 = *xx[1].upper_bound(f);
      long long r = f1 - f;
      if (r > s) return M[make_pair(f, k)] = {-1, -1};
      return M[make_pair(f, k)] = kuro(f1, s - r);
    } else if (xx[2].count(f)) {
      long long f1 = *xx[2].upper_bound(f);
      long long r = f1 - f;
      if (r <= k) {
        return M[make_pair(f, k)] = kuro(f1, k - r);
      } else if (r <= s) {
        pair<long long, long long> ret = kuro(f1, 0);
        ret.second += r - k;
        if (ret.first == -1) ret.second = -1;
        return M[make_pair(f, k)] = ret;
      }
      f1 = *xx[1].upper_bound(f);
      r = f1 - f;
      if (r <= s) {
        pair<long long, long long> ret = kuro(f1, s - r);
        if (ret.first == -1) return {-1, -1};
        ret.second += s - k;
        return M[make_pair(f, k)] = ret;
      }
    }
    if (xx[1].count(f)) {
      long long f1 = *xx[1].upper_bound(f);
      long long r = f1 - f;
      if (r <= k) {
        return M[make_pair(f, k)] = kuro(f1, k - r);
      } else {
        if (r > s)
          return M[make_pair(f, k)] = {-1, -1};
        else {
          pair<long long, long long> ret = kuro(f1, 0);
          if (ret.first == -1) return {-1, -1};
          ret.first += r - k;
          return M[make_pair(f, k)] = ret;
        }
      }
    }
    long long f1 = *xx[1].lower_bound(f);
    long long r = f1 - f;
    if (r <= k) {
      pair<long long, long long> ret = kuro(f1, k - r);
      if (ret.first == -1) return {-1, -1};
      return M[make_pair(f, k)] = ret;
    }
    return M[make_pair(f, k)] = {-1, -1};
  };
  while (m--) {
    long long f;
    cin >> f;
    pair<long long, long long> ans = kuro(f, s);
    cout << ans.first << " " << ans.second << "\n";
  }
}
