#include <bits/stdc++.h>
using namespace std;
long long a, b, m, n, v, w, x[100005], y[100005];
int main() {
  cin >> n >> m;
  for (v = w = n; m--;) {
    cin >> a >> b;
    v -= !x[a]++;
    w -= !y[b]++;
    cout << v * w << ' ';
  }
}
