#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<char> v(n, 0), w(n, 0);
  long long ans1 = n, ans2 = n;
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    if (!v[x]) {
      ans1--;
    }
    if (!w[y]) {
      ans2--;
    }
    v[x] = 1;
    w[y] = 1;
    cout << ans1 * ans2 << " ";
  }
}
