#include <bits/stdc++.h>
using namespace std;
map<int, int> mp1;
map<int, int> mp2;
int main() {
  long long n, m, x, y, maxr = 0, maxc = 0, n1, n2;
  long long o;
  scanf("%lld", &n);
  ;
  scanf("%lld", &m);
  ;
  o = n * n;
  long long ans = 0;
  while (m--) {
    scanf("%lld", &x);
    ;
    scanf("%lld", &y);
    ;
    if (mp1[x] == 0) {
      ++maxr;
      ans += n - maxc;
      mp1[x] = 1;
    }
    if (mp2[y] == 0) {
      ++maxc;
      ans += n - maxr;
      mp2[y] = 1;
    }
    printf("%lld\n", o - ans);
    ;
    o -= ans;
    ans = 0;
  }
  return 0;
}
