#include <bits/stdc++.h>
using namespace std;
long long x[100005], y[112345];
set<long long> stx, sty;
int main() {
  long long n, m, a, b;
  scanf("%lld %lld", &n, &m);
  long long total = n * n;
  while (m--) {
    scanf("%lld %lld", &a, &b);
    if (x[a] == 0 && y[b] == 0) {
      total = total - 2 * n + stx.size() + sty.size() + 1;
    } else if (x[a] && y[b] == 0) {
      total = total - n + stx.size();
    } else if (y[b] && x[a] == 0)
      total = total - n + sty.size();
    x[a] = y[b] = 1;
    stx.insert(a);
    sty.insert(b);
    printf("%lld ", total);
  }
}
