#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int r[N];
int main() {
  int x, q, k;
  scanf("%d", &x);
  scanf("%d", &k);
  for (int i = 0; i < k; i++) scanf("%d", r + i);
  int t, a, Amin = 0, Amax = x, flag = -1, pre = 0, j = 0;
  pre = 0;
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &t, &a);
    while (j < k) {
      if (t > r[j]) {
        Amax = max(0, min(x, Amax + flag * (r[j] - pre)));
        Amin = min(x, max(0, Amin + flag * (r[j] - pre)));
        flag *= -1;
        pre = r[j];
        j++;
      } else
        break;
    }
    int ans;
    cout << Amin << " " << Amax << endl;
    if (flag < 0) {
      ans = min(Amin + a, Amax);
      ans = max(0, ans + flag * (t - pre));
    } else {
      ans = max(Amin, Amax - x + a);
      ans = min(x, ans + flag * (t - pre));
    }
    printf("%d\n", ans);
  }
  return 0;
}
