#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int v[N << 3], s[N << 3], n, m, K, i, j;
set<long long> q;
long long val;
void update(int rt, int l, int r, int pos, int val) {
  if (l == r) {
    s[rt] += val;
    v[rt] = s[rt] ? l + s[rt] : 0;
    return;
  }
  int mid = l + r >> 1;
  pos <= mid ? update((rt << 1), l, mid, pos, val)
             : update((rt << 1 | 1), mid + 1, r, pos, val);
  s[rt] = s[(rt << 1)] + s[(rt << 1 | 1)];
  v[rt] = max(v[(rt << 1 | 1)], v[(rt << 1)] + s[(rt << 1 | 1)]);
}
int main() {
  for (scanf("%d%d%d", &n, &K, &m); m--;) {
    scanf("%d%d", &i, &j);
    val = 1LL * i * 3e5 + j;
    i = j + abs(i - K);
    if (q.count(val))
      q.erase(val), update(1, 0, 2 * n + 10, i, -1);
    else
      q.insert(val), update(1, 0, 2 * n + 10, i, 1);
    printf("%d\n", max(n + 1, v[1]) - n - 1);
  }
}
