#include <bits/stdc++.h>
using namespace std;
long long int row[1000000], col[1000000], rc = 0, cc = 0;
int main() {
  long long int n, m, i, j, k, l, p, r, c, mot;
  scanf("%lld%lld", &n, &m);
  mot = n * n;
  for (i = 1; i <= m; i++) {
    scanf("%lld%lld", &r, &c);
    if (row[r] == 0) {
      mot = mot - n + cc;
      row[r]++;
      rc++;
    }
    if (col[c] == 0) {
      mot = mot - n + rc;
      col[c]++;
      cc++;
    }
    printf("%lld ", mot);
  }
  printf("\n");
  return 0;
}
