#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 79, inf = 1e9 + 79;
int e, s, n, m;
map<int, int> covered(set<pair<int, int> >& s) {
  map<int, int> ans;
  int cnt = 0, sum = 0, last = -inf;
  for (pair<int, int> i : s) {
    if (!cnt) sum += i.first - last;
    ans[i.first] = sum;
    cnt += i.second;
    last = i.first;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> e >> s >> n >> m;
  set<pair<int, int> > s3{{e, 0}}, s23{{e, 0}}, s123{{e, 0}};
  for (int i = 0, x, t; i < n; i++) {
    cin >> t >> x;
    s123.insert({x, 1});
    s123.insert({x + s, -1});
    if (t >= 2) {
      s23.insert({x, 1});
      s23.insert({x + s, -1});
    }
    if (t >= 3) {
      s3.insert({x, 1});
      s3.insert({x + s, -1});
    }
  }
  vector<int> f(m);
  for (int i = 0; i < m; i++) {
    cin >> f[i];
    f[i] += s;
    s123.insert({f[i], 0});
    s23.insert({f[i], 0});
    s3.insert({f[i], 0});
  }
  map<int, int> m123 = covered(s123), m23 = covered(s23), m3 = covered(s3);
  for (int i = 0; i < m; i++) {
    if (f[i] >= e) {
      cout << "0 0\n";
      continue;
    }
    int u123 = m123[e] - m123[f[i]];
    int u23 = m23[e] - m23[f[i]];
    int u3 = m3[e] - m3[f[i]];
    if (u123)
      cout << "-1 -1\n";
    else
      cout << u23 << " " << u3 - u23 << "\n";
  }
  return 0;
}
