#include <bits/stdc++.h>
using namespace std;
struct node {
  int maxi, add, val, block;
  int size, l, r, fix;
  bool flag;
} v[200000 + 20];
void update(int index) {
  v[index].maxi = v[index].val;
  v[index].size = 1;
  if (v[index].l) {
    v[index].size += v[v[index].l].size;
    v[index].maxi = max(v[index].maxi, v[v[index].l].maxi + v[index].add);
  }
  if (v[index].r) {
    v[index].size += v[v[index].r].size;
    v[index].maxi = max(v[index].maxi, v[v[index].r].maxi + v[index].add);
  }
}
void push_down(int index) {
  if (v[index].flag) {
    if (v[index].l) {
      v[v[index].l].flag ^= 1;
      swap(v[v[index].l].l, v[v[index].l].r);
    }
    if (v[index].r) {
      v[v[index].r].flag ^= 1;
      swap(v[v[index].r].l, v[v[index].r].r);
    }
    v[index].flag = 0;
  }
  if (v[index].l) {
    v[v[index].l].add += v[index].add;
    v[v[index].l].maxi += v[index].add;
    v[v[index].l].val += v[index].add;
  }
  if (v[index].r) {
    v[v[index].r].add += v[index].add;
    v[v[index].r].maxi += v[index].add;
    v[v[index].r].val += v[index].add;
  }
  v[index].add = 0;
}
int cnt = 0;
int getnewnode(int val, int block) {
  node tmp;
  tmp.maxi = val;
  tmp.val = val;
  tmp.add = tmp.flag = 0;
  tmp.size = 1;
  tmp.l = tmp.r = 0;
  tmp.block = block;
  tmp.fix = rand() % 1234567890;
  cnt++;
  v[cnt] = tmp;
  return cnt;
}
void split(int base, int& x, int& y, int boundary) {
  if (!base) {
    x = y = 0;
    return;
  }
  if (v[base].size == boundary) {
    x = base;
    y = 0;
    update(x);
  }
  if (!boundary) {
    x = 0;
    y = base;
    update(y);
  }
  push_down(base);
  if (v[v[base].l].size >= boundary) {
    y = base;
    v[y] = v[base];
    split(v[base].l, x, v[y].l, boundary);
    update(y);
  } else {
    x = base;
    v[x] = v[base];
    split(v[base].r, v[x].r, y, boundary - v[v[base].l].size - 1);
    update(x);
  }
}
void split2(int base, int& x, int& y, int boundary) {
  if (!base) {
    x = y = 0;
    return;
  }
  push_down(base);
  if (v[base].block >= boundary) {
    y = base;
    split2(v[base].l, x, v[y].l, boundary);
    update(y);
  } else {
    x = base;
    split2(v[base].r, v[x].r, y, boundary);
    update(x);
  }
}
int merge(int x, int y) {
  if ((!x) || (!y)) {
    if (x + y) {
      update(x + y);
    }
    return x + y;
  }
  if (v[x].fix > v[y].fix) {
    push_down(x);
    v[x].r = merge(v[x].r, y);
    update(x);
    return x;
  } else {
    push_down(y);
    v[y].l = merge(x, v[y].l);
    update(y);
    return y;
  }
}
int root = 1;
map<pair<int, int>, bool> M;
int main() {
  srand(19260817);
  ios::sync_with_stdio(false);
  int n, k, m;
  cin >> n >> k >> m;
  int cnt = 0;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    int val = y + abs(x - k);
    if (M[make_pair(x, y)]) {
      cnt--;
      if (cnt == 0) {
        cnt = 0;
        M[make_pair(x, y)] = 0;
        cout << 0 << endl;
        continue;
      } else {
        int L, R;
        split2(root, L, R, val);
        int MID;
        split(R, MID, R, 1);
        v[L].add--;
        v[L].val--;
        v[L].maxi--;
        root = merge(L, R);
      }
    } else {
      cnt++;
      if (cnt == 1) {
        root = getnewnode(val, val);
      } else {
        int L, R;
        split2(root, L, R, val);
        if (L) {
          v[L].add++;
          v[L].val++;
          v[L].maxi++;
        }
        int Add = 0;
        if (R) Add += v[R].size;
        int MID = getnewnode(Add + val, val);
        L = merge(L, MID);
        root = merge(L, R);
      }
    }
    cout << max(0, v[root].maxi - n) << endl;
    M[make_pair(x, y)] ^= 1;
  }
  return 0;
}
