#include <bits/stdc++.h>
using namespace std;
set<long long> s, c;
int main() {
  long long n, m;
  cin >> n >> m;
  for (int(i) = (0); (i) < (m); (i)++) {
    long long a, b;
    cin >> a >> b;
    s.insert(a);
    c.insert(b);
    long long d =
        1LL * s.size() * n + 1LL * c.size() * n - (s.size() * 1LL * c.size());
    cout << n * n * 1LL - d << "\n";
  }
}
