#include <bits/stdc++.h>
using namespace std;
const int maxN = 200000 + 5;
struct SegTree {
  int mx, ad;
} t[(maxN * 2) << 2];
int cnt[maxN * 2];
int n, k, m;
set<pair<int, int> > s;
set<int> s2;
void pushup(int u) { t[u].mx = max(t[u << 1].mx, t[u << 1 | 1].mx); }
void pushdown(int u) {
  if (t[u].ad != 0) {
    t[u << 1].mx += t[u].ad;
    t[u << 1 | 1].mx += t[u].ad;
    t[u << 1].ad += t[u].ad;
    t[u << 1 | 1].ad += t[u].ad;
    t[u].ad = 0;
  }
}
void build(int u, int l, int r) {
  if (l == r) {
    t[u].mx = l - n;
    return;
  }
  int m = (l + r) >> 1;
  build(u << 1, l, m);
  build(u << 1 | 1, m + 1, r);
  pushup(u);
}
void update(int u, int l, int r, int ul, int ur, int val) {
  if (ul <= l && r <= ur) {
    t[u].mx += val;
    t[u].ad += val;
    return;
  }
  pushdown(u);
  int m = (l + r) >> 1;
  if (ul <= m) update(u << 1, l, m, ul, ur, val);
  if (ur > m) update(u << 1 | 1, m + 1, r, ul, ur, val);
  pushup(u);
}
int query(int u, int l, int r, int ql, int qr) {
  if (ql <= l && r <= qr) return t[u].mx;
  if (qr < l || ql > r) return 0;
  pushdown(u);
  int m = (l + r) >> 1;
  return max(query(u << 1, l, m, ql, qr), query(u << 1 | 1, m + 1, r, ql, qr));
}
int main() {
  scanf("%d%d%d", &n, &k, &m);
  build(1, 0, n * 2);
  while (m--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int val = 1, row = abs(x - k) + y - 1;
    set<pair<int, int> >::iterator it = s.find(make_pair(x, y));
    if (it != s.end()) {
      s.erase(it);
      val = -1;
      --cnt[row];
      if (!cnt[row]) s2.erase(row);
    } else {
      s.insert(make_pair(x, y));
      ++cnt[row];
      if (cnt[row] == 1) s2.insert(row);
    }
    update(1, 0, n * 2, 0, row, val);
    if (!s2.empty())
      printf("%d\n", max(query(1, 0, n * 2, 0, *s2.rbegin()), 0));
    else
      printf("0\n");
  }
  return 0;
}
