#include <bits/stdc++.h>
using namespace std;
int e, s, n, m;
pair<int, int> f[400010], a[400010], ans[400010];
class que {
 public:
  int dat[200010];
  int s, e;
  que() { s = e = 0; }
  int& operator[](int x) { return dat[x]; }
  const int& operator[](const int x) const { return dat[x]; }
  inline bool empty() { return e <= s; }
  inline int head() { return dat[s]; }
} q[4];
int main() {
  memset(ans, 255, sizeof(ans));
  scanf("%d%d%d%d", &e, &s, &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].second, &a[i].first);
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i + n].first);
    a[i + n].second = 3 + i;
  }
  sort(a + 1, a + n + m + 1);
  int pos = 0;
  for (pos = 1; pos <= n + m; pos++) {
    if (a[pos].first > e) break;
  }
  if (a[pos].first == e) pos--;
  a[pos].first = e;
  a[pos].second = 3;
  e = pos;
  f[e] = make_pair(0, 0);
  q[3][q[3].e++] = e;
  for (int i = e - 1; i >= 1; i--) {
    int t = 0x3f3f3f3f;
    while (!q[3].empty() && a[q[3].head()].first - a[i].first > s) q[3].s++;
    while (!q[2].empty() && a[q[2].head()].first - a[i].first > s) q[2].s++;
    while (!q[1].empty() && a[q[1].head()].first - a[i].first > s) q[1].s++;
    if (a[i].second > 3) {
      for (int j = 3; j >= 1; j--) {
        if (!q[j].empty()) {
          if (j == 1)
            ans[a[i].second - 3] = make_pair(
                f[q[j].head()].first - s + a[q[j].head()].first - a[i].first,
                f[q[j].head()].second);
          else if (j == 2)
            ans[a[i].second - 3] = make_pair(
                f[q[j].head()].first,
                f[q[j].head()].second - s + a[q[j].head()].first - a[i].first);
          else
            ans[a[i].second - 3] =
                make_pair(f[q[j].head()].first, f[q[j].head()].second);
          break;
        }
      }
      continue;
    }
    int j;
    for (j = 3; j >= a[i].second; j--)
      if (!q[j].empty()) t = min(t, q[j][q[j].e - 1]);
    if (t == 0x3f3f3f3f) {
      for (; j > 0; j--) {
        if (!q[j].empty()) {
          t = q[j].head();
          break;
        }
      }
    }
    if (t == 0x3f3f3f3f) break;
    f[i] = f[t];
    if (a[t].second >= a[i].second) {
      if (a[i].second == 1)
        f[i].first += a[t].first - a[i].first;
      else if (a[i].second == 2)
        f[i].second += a[t].first - a[i].first;
    } else {
      if (a[i].second == 2) {
        f[i].second += s;
        f[i].first -= s - a[t].first + a[i].first;
      } else if (a[i].second == 3) {
        if (a[t].second == 2)
          f[i].second -= s - a[t].first + a[i].first;
        else
          f[i].first -= s - a[t].first + a[i].first;
      }
    }
    q[a[i].second][q[a[i].second].e++] = i;
  }
  for (int i = 1; i <= m; i++) printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
