#include <bits/stdc++.h>
using namespace std;
int n, m;
int dh[100001], dc[100001];
long long sh = 0, sc = 0;
void doc() {
  cin >> n >> m;
  long long tong = (long long)n * n;
  int u, v;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v;
    if (dh[u] == 0) dh[u] = 1, sh++;
    if (dc[v] == 0) dc[v] = 1, sc++;
    long long kq = tong - (sh + sc) * n + sh * sc;
    cout << kq << " ";
  }
}
int main() { doc(); }
