#include <bits/stdc++.h>
using namespace std;
map<int, pair<int, pair<int, int> > > ans;
set<int> s1, s2, s3, s;
map<int, int> type;
int main() {
  int e, cap, n, m;
  scanf("%d%d%d%d", &e, &cap, &n, &m);
  for (int i = 0; i < n; i++) {
    int t, x;
    scanf("%d%d", &t, &x);
    type[x] = t;
    s.insert(x);
  }
  s.insert(e);
  ans[e] = make_pair(0, make_pair(0, 0));
  for (set<int>::iterator it = s.begin(); it != s.end(); it++) {
    int x = *it;
    if (x < e) {
      if (type[x] == 1) s1.insert(x);
      if (type[x] == 2) s2.insert(x);
      if (type[x] == 3) s3.insert(x);
    }
  }
  set<int>::iterator it = s.find(e);
  s3.insert(e);
  s2.insert(e);
  s1.insert(e);
  if (it != s.begin()) {
    while (1) {
      it--;
      int x = *it;
      int x1 = *s1.upper_bound(x);
      int x2 = *s2.upper_bound(x);
      int x3 = *s3.upper_bound(x);
      if (type[x] == 3) {
        if (x3 - x <= cap) {
          if (ans[x3].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else
            ans[x] = ans[x3];
        } else if (x2 - x <= cap) {
          set<int>::iterator it2 = s2.upper_bound(x + cap);
          it2--;
          x2 = *it2;
          if (ans[x2].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else
            ans[x] = make_pair(cap, make_pair(ans[x2].first - (x + cap - x2) +
                                                  ans[x2].second.first,
                                              ans[x2].second.second));
        } else if (x1 - x <= cap) {
          set<int>::iterator it1 = s1.upper_bound(x + cap);
          it1--;
          x1 = *it1;
          if (ans[x1].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else
            ans[x] = make_pair(cap, make_pair(ans[x1].second.first,
                                              ans[x1].first - (x + cap - x1) +
                                                  ans[x1].second.second));
        } else
          ans[x] = make_pair(-1, make_pair(-1, -1));
      } else if (type[x] == 2) {
        if (x3 - x <= cap) {
          if (ans[x3].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else {
            ans[x] = ans[x3];
            ans[x].first = x3 - x;
          }
        } else if (x2 - x <= cap) {
          if (ans[x2].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else {
            ans[x] = ans[x2];
            ans[x].first = x2 - x;
            ans[x].second.first += ans[x2].first;
          }
        } else if (x1 - x <= cap) {
          set<int>::iterator it1 = s1.upper_bound(x + cap);
          it1--;
          x1 = *it1;
          if (ans[x1].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else
            ans[x] = make_pair(cap, make_pair(ans[x1].second.first,
                                              ans[x1].first - (x + cap - x1) +
                                                  ans[x1].second.second));
        } else
          ans[x] = make_pair(-1, make_pair(-1, -1));
      } else if (type[x] == 1) {
        if (min(x2, x3) - x <= cap) {
          if (x3 < x2) {
            if (ans[x3].first == -1)
              ans[x] = make_pair(-1, make_pair(-1, -1));
            else {
              ans[x] = ans[x3];
              ans[x].first = x3 - x;
            }
          } else {
            if (ans[x2].first == -1)
              ans[x] = make_pair(-1, make_pair(-1, -1));
            else {
              ans[x] = ans[x2];
              ans[x].first = x2 - x;
              ans[x].second.first += ans[x2].first;
            }
          }
        } else if (x1 - x <= cap) {
          if (ans[x1].first == -1)
            ans[x] = make_pair(-1, make_pair(-1, -1));
          else {
            ans[x] = ans[x1];
            ans[x].first = x1 - x;
            ans[x].second.second += ans[x1].first;
          }
        } else
          ans[x] = make_pair(-1, make_pair(-1, -1));
      }
      if (it == s.begin()) break;
    }
  }
  while (m--) {
    int f;
    scanf("%d", &f);
    it = s.lower_bound(f);
    int x = *it;
    pair<int, int> fin;
    if (x - f > cap)
      fin = make_pair(-1, -1);
    else if (e - f <= cap)
      fin = make_pair(0, 0);
    else if (ans[x].first == -1)
      fin = make_pair(-1, -1);
    else {
      int x1 = *s1.lower_bound(f);
      int x2 = *s2.lower_bound(f);
      int x3 = *s3.lower_bound(f);
      if (x3 - f <= cap)
        fin = ans[x3].second;
      else if (x2 - f <= cap) {
        set<int>::iterator it2 = s2.upper_bound(f + cap);
        it2--;
        x2 = *it2;
        if (ans[x2].first == -1)
          fin = make_pair(-1, -1);
        else
          fin = make_pair(ans[x2].first - (f + cap - x2) + ans[x2].second.first,
                          ans[x2].second.second);
      } else if (x1 - f <= cap) {
        set<int>::iterator it1 = s1.upper_bound(f + cap);
        it1--;
        x1 = *it1;
        if (ans[x1].first == -1)
          fin = make_pair(-1, -1);
        else
          fin = make_pair(ans[x1].second.first, ans[x1].first - (f + cap - x1) +
                                                    ans[x1].second.second);
      }
    }
    printf("%d %d\n", fin.second, fin.first);
  }
  return 0;
}
