#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
const long long MOD2 = (long long)1000000007 * (long long)1000000007;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 1000000007) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int T[(400135) * 4], lz[(400135) * 4];
void Up(int rt, int l, int r) { T[rt] = max(T[(rt << 1)], T[(rt << 1 | 1)]); }
void build(int rt, int l, int r) {
  if (l + 1 == r) {
    T[rt] = l;
    return;
  }
  int mid = (l + r) / 2;
  build((rt << 1), l, mid);
  build((rt << 1 | 1), mid, r);
  Up(rt, l, r);
}
void Down(int rt, int l, int r) {
  if (lz[rt] != 0) {
    T[(rt << 1)] += lz[rt];
    lz[(rt << 1)] += lz[rt];
    T[(rt << 1 | 1)] += lz[rt];
    lz[(rt << 1 | 1)] += lz[rt];
    lz[rt] = 0;
  }
}
void upt(int rt, int l, int r, int L, int R, int val) {
  if (R <= l || r <= L) return;
  if (L <= l && r <= R) {
    T[rt] += val;
    lz[rt] += val;
    return;
  }
  Down(rt, l, r);
  int mid = (l + r) / 2;
  upt((rt << 1), l, mid, L, R, val);
  upt((rt << 1 | 1), mid, r, L, R, val);
  Up(rt, l, r);
}
int qy(int rt, int l, int r, int L, int R) {
  if (R <= l || r <= L) return -(1 << 30);
  if (L <= l && r <= R) {
    return T[rt];
  }
  Down(rt, l, r);
  int mid = (l + r) / 2;
  return max(qy((rt << 1), l, mid, L, R), qy((rt << 1 | 1), mid, r, L, R));
}
void fmain(int tid) {
  scanf("%d%d%d", &n, &k, &m);
  build(1, 0, n + n);
  set<pair<int, int> > sp;
  multiset<int> rs;
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    int x, y;
    scanf("%d%d", &x, &y);
    int j = abs(k - x) + y;
    if (sp.find({x, y}) == sp.end()) {
      sp.insert({x, y});
      rs.insert(j);
      upt(1, 0, n + n, 0, j, 1);
    } else {
      sp.erase({x, y});
      rs.erase(rs.find(j));
      upt(1, 0, n + n, 0, j, -1);
    }
    if (rs.empty())
      puts("0");
    else {
      int mx = *rs.rbegin();
      int A = qy(1, 0, n + n, 0, mx);
      printf("%d\n", max(A - n, 0));
    }
  }
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
