#include <bits/stdc++.h>
using namespace std;
const int maxn = 1600100;
int tree[maxn];
int lazy[maxn];
int n, m;
int haha = 0;
void build(int node = 1, int l = 1, int r = n) {
  if (l == r) {
    tree[node] = haha++;
    return;
  }
  int mid = (l + r) / 2;
  build(node << 1, l, mid);
  build((node << 1) + 1, mid + 1, r);
  tree[node] = std::max(tree[node << 1], tree[(node << 1) + 1]);
}
void pushdown(int node) {
  if (lazy[node] != 0) {
    lazy[node << 1] += lazy[node];
    lazy[(node << 1) + 1] += lazy[node];
    tree[node << 1] += lazy[node];
    tree[(node << 1) + 1] += lazy[node];
    lazy[node] = 0;
  }
}
int g_L, g_R, g_Add;
void change(int node = 1, int l = 1, int r = n) {
  if (g_L <= l && r <= g_R) {
    tree[node] += g_Add;
    lazy[node] += g_Add;
    return;
  }
  int mid = (l + r) / 2;
  int lc = node << 1;
  int rc = (node << 1) + 1;
  pushdown(node);
  if (g_L <= mid) change(lc, l, mid);
  if (g_R > mid) change(rc, mid + 1, r);
  tree[node] = std::max(tree[lc], tree[rc]);
}
int query(int node = 1, int l = 1, int r = n) {
  if (g_L <= l && r <= g_R) {
    return tree[node];
  }
  int mid = (l + r) / 2;
  int lc = node << 1;
  int rc = (node << 1) + 1;
  pushdown(node);
  int ans = 0x80000000;
  if (g_L <= mid) ans = std::max(ans, query(lc, l, mid));
  if (g_R > mid) ans = std::max(ans, query(rc, mid + 1, r));
  return ans;
}
map<pair<int, int>, int> oxy;
multiset<int, greater<int>> wuwu;
int main() {
  int nn, k;
  scanf("%d%d", &nn, &k);
  n = 2 * nn;
  build();
  scanf("%d", &m);
  while (m--) {
    int xx, yy;
    scanf("%d%d", &xx, &yy);
    if (oxy[make_pair(xx, yy)] == 0) {
      oxy[make_pair(xx, yy)] = 1;
      xx = abs(k - xx) + yy;
      wuwu.insert(xx);
      g_L = 1;
      g_R = xx;
      g_Add = 1;
      change();
      xx = *wuwu.begin();
      g_L = 1;
      g_R = xx;
      printf("%d\n", max(0, query() - nn));
    } else {
      oxy[make_pair(xx, yy)] = 0;
      xx = abs(k - xx) + yy;
      wuwu.erase(wuwu.find(xx));
      g_L = 1;
      g_R = xx;
      g_Add = -1;
      change();
      if (wuwu.empty() == 1)
        printf("0\n");
      else {
        xx = *wuwu.begin();
        g_L = 1;
        g_R = xx;
        printf("%d\n", max(0, query() - nn));
      }
    }
  }
  return 0;
}
