#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001;
const long long identity = 0;
const long long SZ = 400002;
long long sum[4 * SZ], lazy[4 * SZ];
long long combine(long long A, long long B) { return max(A, B); }
long long combineUpd(long long A, long long B) { return A + B; }
void push(int index, long long L, long long R) {
  sum[index] = combineUpd(sum[index], lazy[index]);
  if (L != R)
    lazy[2 * index] = combineUpd(lazy[2 * index], lazy[index]),
             lazy[2 * index + 1] = combineUpd(lazy[2 * index + 1], lazy[index]);
  lazy[index] = identity;
}
void pull(int index) {
  sum[index] = combine(sum[2 * index], sum[2 * index + 1]);
}
long long query(int lo, int hi, int index = 1, long long L = 1,
                long long R = SZ - 1) {
  push(index, L, R);
  if (lo > R || L > hi) return 0;
  if (lo <= L && R <= hi) return sum[index];
  int M = (L + R) / 2;
  return combine(query(lo, hi, 2 * index, L, M),
                 query(lo, hi, 2 * index + 1, M + 1, R));
}
void update(int lo, int hi, long long increase, int index = 1, long long L = 1,
            long long R = SZ - 1) {
  push(index, L, R);
  if (hi < L || R < lo) return;
  if (lo <= L && R <= hi) {
    lazy[index] = increase;
    push(index, L, R);
    return;
  }
  int M = (L + R) / 2;
  update(lo, hi, increase, 2 * index, L, M);
  update(lo, hi, increase, 2 * index + 1, M + 1, R);
  pull(index);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N, K, M;
  cin >> N >> K >> M;
  for (int i = 0; i < (2 * SZ); i++) sum[i] = 0, lazy[i] = 0;
  for (int i = 0; i < (2 * SZ); i++) {
    update(i, i, i);
  }
  set<pair<int, int> > S;
  priority_queue<pair<int, pair<int, int> > > q;
  for (int i = 0; i < (M); i++) {
    int A, B;
    cin >> A >> B;
    int cur = B + abs(K - A);
    if (S.count({A, B})) {
      S.erase({A, B});
      update(1, cur, -1);
    } else {
      S.insert({A, B});
      update(1, cur, 1);
      q.push({cur, {A, B}});
    }
    while (!q.empty() && !S.count(q.top().second)) {
      q.pop();
    }
    if (q.empty()) {
      cout << 0 << nl;
    } else {
      cout << max(query(1, q.top().first) - N - 1, 0ll) << nl;
    }
  }
  return 0;
}
