#include <bits/stdc++.h>
using namespace std;
int arr_sorted[1000000];
int arr_pos[1000000];
int arr_typ[1000000];
int arr_inpPos[1000000];
int arr_fuels[1000000][3];
int size = 0;
bool cmp(int a, int b) {
  return arr_pos[a] < arr_pos[b] ||
         (arr_pos[a] == arr_pos[b] && arr_typ[a] == 0);
}
void processStops(int s) {
  int in = size - 1;
  while (arr_sorted[in] != 0) in--;
  int last[] = {in, in, in};
  int first[] = {in, in, in};
  while (in--) {
    int index = arr_sorted[in];
    int typ_orig = arr_typ[index];
    int typ = typ_orig == 0 ? 3 : typ_orig;
    int pos = arr_pos[index];
    for (int lii = 0; lii < 3; lii++) {
      int lastType = lii + 1;
      int li = last[lii];
      if (li > in && arr_pos[arr_sorted[li]] > pos + s) {
        while (li >= 0 && ((arr_pos[arr_sorted[li]] > pos + s) ||
                           arr_typ[arr_sorted[li]] != lastType))
          li--;
        last[lii] = li;
      }
    }
    int best = -1;
    for (int i = 0; i < 3; i++) {
      if (i < typ - 1) continue;
      int ind = arr_sorted[first[i]];
      if ((best == -1 || arr_pos[best] > arr_pos[ind]) &&
          arr_pos[ind] <= pos + s)
        best = ind;
    }
    int worse = -1;
    for (int i = 0; i < typ - 1; i++) {
      int ind = arr_sorted[first[i]];
      if (arr_pos[ind] <= pos + s) {
        worse = ind;
      }
    }
    if (best > -1) {
      if (arr_fuels[best][0] > -1) {
        arr_fuels[index][0] = arr_fuels[best][0];
        arr_fuels[index][1] = arr_fuels[best][1];
        arr_fuels[index][typ - 1] =
            arr_fuels[index][typ - 1] + arr_pos[best] - pos;
      }
    } else if (worse > -1 && arr_fuels[worse][0] > -1) {
      arr_fuels[index][0] = arr_fuels[worse][0];
      arr_fuels[index][1] = arr_fuels[worse][1];
      arr_fuels[index][typ - 1] = arr_fuels[index][typ - 1] + s;
      arr_fuels[index][arr_typ[worse] - 1] =
          arr_fuels[index][arr_typ[worse] - 1] - (s - (arr_pos[worse] - pos));
    }
    if (typ_orig > 0) first[typ_orig - 1] = in;
  }
}
int main() {
  int e, s, n, m;
  cin >> e >> s >> n >> m;
  arr_sorted[0] = 0;
  arr_pos[0] = e;
  arr_typ[0] = 3;
  arr_inpPos[0] = 0;
  arr_fuels[0][0] = 0;
  arr_fuels[0][1] = 0;
  arr_fuels[0][2] = 0;
  int n1 = n;
  int m1 = m;
  size = 1;
  while (n1--) {
    int t, p;
    cin >> t >> p;
    arr_pos[size] = p;
    arr_typ[size] = t;
    arr_inpPos[size] = 0;
    arr_fuels[size][0] = -1;
    arr_fuels[size][1] = -1;
    arr_fuels[size][2] = 0;
    arr_sorted[size] = size;
    size++;
  }
  while (m1--) {
    int p;
    cin >> p;
    arr_pos[size] = p;
    arr_typ[size] = 0;
    arr_inpPos[size] = m - m1;
    arr_fuels[size][0] = -1;
    arr_fuels[size][1] = -1;
    arr_fuels[size][2] = 0;
    arr_sorted[size] = size;
    size++;
  }
  sort(arr_sorted, arr_sorted + size, cmp);
  processStops(s);
  for (int i = 0; i < m; i++) {
    cout << arr_fuels[n + 1 + i][0] << " " << arr_fuels[n + 1 + i][1] << endl;
  }
}
