#include <bits/stdc++.h>
using namespace std;
void sol() {
  long long int n, m;
  cin >> n >> m;
  map<int, int> x;
  map<int, int> y;
  long long int ans = n * n;
  long long int k = 0;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    if (x.find(a) == x.end() and y.find(b) == y.end()) {
      k = 2 * n - x.size() - y.size() - 1;
    } else if (x.find(a) == x.end()) {
      k = n - y.size();
    } else if (y.find(b) == y.end()) {
      k = n - x.size();
    } else {
      k = 0;
    }
    ans -= k;
    cout << ans << " ";
    x[a] = 1;
    y[b] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  sol();
}
