#include <bits/stdc++.h>
using namespace std;
int a[100010];
int b[100010];
int main() {
  int m, i, x, y;
  long long int n;
  scanf("%I64d%d", &n, &m);
  int c = n, r = n;
  long long int sum = n * n;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    if (a[x] == 0 && b[y] == 0) {
      sum = sum - c - r + 1;
      c--;
      r--;
      a[x] = 1;
      b[y] = 1;
    } else if (a[x] == 1 && b[y] == 0) {
      sum = sum - r;
      c--;
      b[y] = 1;
    } else if (a[x] == 0 && b[y] == 1) {
      sum = sum - c;
      r--;
      a[x] = 1;
    }
    printf("%I64d\n", sum);
  }
  return 0;
}
