#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i, h[100002], v[100002], hl = 0, vl = 0, x, y;
  long long int ans;
  cin >> n;
  cin >> m;
  ans = (long long int)n * n;
  for (i = 0; i <= n; i++) {
    h[i] = 0;
    v[i] = 0;
  }
  for (i = 0; i < m; i++) {
    cin >> x;
    cin >> y;
    if (ans) {
      if (!h[x] && !v[y]) {
        hl++;
        vl++;
        h[x] = 1;
        v[y] = 1;
        ans = ans - 2 * n - 1 + hl + vl;
      } else if (!h[x] && v[y]) {
        hl++;
        h[x] = 1;
        ans = ans - n + vl;
      } else if (h[x] && !v[y]) {
        vl++;
        v[y] = 1;
        ans = ans - n + hl;
      }
    }
    cout << ans << " ";
  }
  cout << endl;
  return 0;
}
