#include <bits/stdc++.h>
using namespace std;
long long mark[100005][2];
int main(void) {
  ios_base::sync_with_stdio(0);
  long long a, n, b, m, c, d, e, t, f;
  cin >> n >> m;
  long long count = n * n;
  long long cx = 0, cy = 0;
  vector<long long> v;
  while (m--) {
    long long x, y;
    cin >> x >> y;
    if (mark[x][0] and mark[y][1])
      count -= 0;
    else if (mark[x][0]) {
      count -= n;
      count += cx;
      cy++;
    } else if (mark[y][1]) {
      count -= n;
      count += cy;
      cx++;
    } else {
      count -= 2 * n;
      cx++;
      cy++;
      count += cx;
      count += cy;
      count -= 1;
    }
    mark[x][0] = 1;
    mark[y][1] = 1;
    v.push_back(max((long long)0, count));
  }
  for (a = 0; a < v.size(); a++) cout << v[a] << " ";
  return 0;
}
