#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int ans = n * n;
  bool r[1000009] = {0}, c[1000009] = {0};
  long long int cr = 0, cc = 0;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    if (r[x] == 0) cr++;
    if (c[y] == 0) cc++;
    r[x] = 1, c[y] = 1;
    long long int f = ans - n * (cr + cc) + cr * cc;
    cout << f << " ";
  }
}
