#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2e5;
int N, K, Q;
set<long long> q;
struct Aint {
  int s[NMAX * 8], t[NMAX * 8];
  void Update(int node, int st, int dr, int pos, int val) {
    if (st == dr) {
      t[node] += val;
      if (t[node])
        s[node] = st + t[node] - 1;
      else
        s[node] = 0;
      return;
    }
    int mid = (st + dr) >> 1;
    if (pos <= mid)
      Update(2 * node, st, mid, pos, val);
    else
      Update(2 * node + 1, mid + 1, dr, pos, val);
    t[node] = t[2 * node] + t[2 * node + 1];
    if (s[2 * node] <= mid)
      s[node] = max(s[2 * node], s[2 * node + 1]);
    else {
      int tr = s[2 * node + 1] - mid;
      int tfr = tr - t[2 * node + 1];
      int xl = s[2 * node] - mid;
      if (xl < tfr)
        s[node] = s[2 * node + 1];
      else
        s[node] = s[2 * node + 1] + xl - tfr;
    }
  }
};
Aint aint;
int ABS(int x) { return max(x, -x); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> K >> Q;
  for (int i = 1; i <= Q; i++) {
    int x, y;
    cin >> x >> y;
    long long pos = 1LL * x * 300000 + y;
    int line = y + ABS(K - x);
    if (q.find(pos) == q.end()) {
      q.insert(pos);
      aint.Update(1, 1, 2 * N, line, 1);
    } else {
      q.erase(q.find(pos));
      aint.Update(1, 1, 2 * N, line, -1);
    }
    cout << max(N, aint.s[1]) - N << '\n';
  }
  return 0;
}
