#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 10;
const double MIN = 1e-6;
struct num {
  int x, y;
} a[MAX];
int main() {
  int n, m, i, b, c, l, tx = 0, ty = 0;
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  long long ans = (long long)n * n;
  for (i = 1; i <= m; i++) {
    cin >> b >> c;
    a[b].x++;
    a[c].y++;
    if (a[b].x > 1 && a[c].y > 1)
      l = 0;
    else if (a[b].x > 1 && a[c].y <= 1)
      l = n - tx, ty++;
    else if (a[b].x <= 1 && a[c].y > 1)
      l = n - ty, tx++;
    else
      l = 2 * n - 1 - tx - ty, tx++, ty++;
    ans -= l;
    cout << ans << endl;
  }
  return 0;
}
