#include <bits/stdc++.h>
using namespace std;
set<int> sx, sy;
int main() {
  int n, m;
  cin >> n >> m;
  int x, y;
  long long tot = n * 1LL * n;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    sx.insert(x);
    sy.insert(y);
    long long xsiz = sx.size();
    long long ysiz = sy.size();
    cout << tot - (xsiz + ysiz) * 1LL * n + xsiz * ysiz << endl;
  }
}
