#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const int NINF = INT_MIN;
const long long INF_LL = LLONG_MAX;
const long long NINF_LL = LLONG_MIN;
const double PI = acos(-1.0);
const int MOD = 1e9 + 7;
int main() {
  long long n, m;
  cin >> n >> m;
  long long ans = n * n;
  int nr = 0, nc = 0;
  vector<bool> r(n, false), c(n, false);
  while (m--) {
    int y, x;
    cin >> y >> x;
    --x, --y;
    bool ds = false;
    if (!r[y] and !c[x]) {
      --ans;
      ds = true;
    }
    if (!r[y]) {
      ans -= (n - nc - ds);
    }
    if (!c[x]) {
      ans -= (n - nr - ds);
    }
    if (!r[y]) {
      nr++;
      r[y] = true;
    }
    if (!c[x]) {
      nc++;
      c[x] = true;
    }
    cout << ans;
    if (m) cout << " ";
  }
  cout << endl;
  return 0;
}
