#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
int n, m, k;
int l, r, val;
int frq[N];
map<pair<int, int>, bool> has;
int seg[4 * N], lazy[4 * N];
inline void fix(int s, int e, int idx) {
  seg[idx] += lazy[idx];
  if (s != e) {
    lazy[(idx << 1)] += lazy[idx];
    lazy[(idx << 1) + 1] += lazy[idx];
  }
  lazy[idx] = 0;
}
int update(int s, int e, int idx) {
  fix(s, e, idx);
  if (s > r || e < l) return seg[idx];
  if (s >= l && e <= r) {
    lazy[idx] += val;
    fix(s, e, idx);
    return seg[idx];
  }
  return seg[idx] = max(update(s, ((s + e) >> 1), (idx << 1)),
                        update(((s + e) >> 1) + 1, e, (idx << 1) + 1));
}
int getmax(int s, int e, int idx) {
  fix(s, e, idx);
  if (s > r || e < l) return 0;
  if (s >= l && e <= r) return seg[idx];
  return max(getmax(s, ((s + e) >> 1), (idx << 1)),
             getmax(((s + e) >> 1) + 1, e, (idx << 1) + 1));
}
int main() {
  scanf("%d%d%d", &n, &k, &m);
  int a, b, inc, ans;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    if (has[make_pair(a, b)] == true) {
      inc = -1;
      has[make_pair(a, b)] = false;
    } else {
      inc = 1;
      has[make_pair(a, b)] = true;
    }
    a = abs(a - k);
    b += a;
    frq[b] += inc;
    if (frq[b] == 0 && inc == -1) {
      l = r = b;
      val = -b;
      update(1, N, 1);
    }
    if (frq[b] == 1 && inc == 1) {
      l = r = val = b;
      update(1, N, 1);
    }
    l = 1, r = b, val = inc;
    update(1, N, 1);
    l = 1, r = N;
    ans = getmax(1, N, 1) - 1;
    ans = max(0, ans - n);
    printf("%d\n", ans);
  }
  return 0;
}
