#include <bits/stdc++.h>
using namespace std;
const int MAX = 1 << 18, VELB = 1 << 16;
int kap;
vector<pair<int, int> > E;
pair<int, int> rje[MAX];
vector<pair<int, int> > V[2][VELB];
void Sortiraj() {
  for (int i = 0; i < (int)E.size(); i++)
    V[0][E[i].first % VELB].push_back(E[i]);
  for (int i = 0; i < VELB; i++)
    for (int j = 0; j < (int)V[0][i].size(); j++)
      V[1][V[0][i][j].first / VELB].push_back(V[0][i][j]);
  E.clear();
  for (int i = 0; i < VELB; i++)
    for (int j = 0; j < (int)V[1][i].size(); j++) E.push_back(V[1][i][j]);
  for (int i = 0; i < (int)E.size() / 2; i++) swap(E[i], E[E.size() - 1 - i]);
}
pair<int, int> MaxPop(pair<int, int> pop, int sum) {
  if (pop.first >= sum) return pair<int, int>(sum, 0);
  if (pop.first + pop.second >= sum)
    return pair<int, int>(pop.first, sum - pop.first);
  return pop;
}
void Spoji(int tip, int udalj, pair<int, int> treb, pair<int, int> prom,
           pair<int, int> &ntreb, pair<int, int> &nprom) {
  if (udalj > kap || treb == pair<int, int>(-1, -1)) {
    ntreb = pair<int, int>(-1, -1);
    return;
  }
  if (tip == 1) {
    ntreb = pair<int, int>(treb.first + udalj, treb.second);
    nprom = MaxPop(pair<int, int>(prom.first + udalj, prom.second), kap);
  } else if (tip == 2) {
    int ost = kap - udalj;
    int popX = min(ost, prom.first);
    ntreb = pair<int, int>(treb.first - popX, treb.second + udalj + popX);
    nprom = MaxPop(pair<int, int>(0, prom.second + udalj + popX), kap);
  } else {
    int ost = kap - udalj;
    int popX = min(ost, prom.first);
    int popY = min(ost - popX, prom.second);
    ntreb = pair<int, int>(treb.first - popX, treb.second - popY);
    nprom = pair<int, int>(0, 0);
  }
}
int main() {
  int kraj, n, q, zadx;
  pair<int, int> treb = pair<int, int>(0, 0), prom = pair<int, int>(0, 0);
  scanf("%d%d%d%d", &kraj, &kap, &n, &q);
  kraj += (int)(1e9);
  zadx = kraj;
  for (int i = 0; i < n; i++) {
    int tip, x;
    scanf("%d%d", &tip, &x);
    x += (int)(1e9);
    if (x < kraj) E.push_back(pair<int, int>(x, tip));
  }
  for (int i = 0; i < q; i++) {
    int x;
    scanf("%d", &x);
    x += (int)(1e9);
    E.push_back(pair<int, int>(x, -i));
  }
  Sortiraj();
  for (int i = 0; i < (int)E.size(); i++) {
    int udalj = zadx - E[i].first;
    int tip = E[i].second;
    if (E[i].second <= 0) tip = 3;
    pair<int, int> ntreb, nprom;
    Spoji(tip, udalj, treb, prom, ntreb, nprom);
    if (E[i].second <= 0)
      rje[-E[i].second] = ntreb;
    else {
      zadx = E[i].first;
      treb = ntreb;
      prom = nprom;
    }
  }
  for (int i = 0; i < q; i++) printf("%d %d\n", rje[i].first, rje[i].second);
  return 0;
}
