#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n, m, x, y;
  cin >> n >> m;
  long long r[n + 1], c[n + 1], rows = 0, cols = 0;
  for (int i = 0; i <= n; i++) r[i] = c[i] = 0;
  long long ans = n * n;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    if (r[x] && c[y]) {
    } else if (!r[x] && !c[y]) {
      r[x] = c[y] = 1;
      ans -= (2 * n - rows - cols - 1);
      rows++;
      cols++;
    } else if (r[x]) {
      c[y] = 1;
      ans -= (n - rows);
      cols++;
    } else {
      r[x] = 1;
      ans -= (n - cols);
      rows++;
    }
    cout << ans << endl;
  }
  return 0;
}
