#include <bits/stdc++.h>
using namespace std;
long long n, m, x, y, used1, used2, now;
bool row[100005], column[100005];
int main() {
  cin >> n >> m;
  now = n * n;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    if (column[y] == 0 && row[x] == 0) {
      now -= n - used1;
      used1++;
      now -= n - used2;
      used2++;
      column[y] = 1;
      row[x] = 1;
      now++;
      cout << now << endl;
      continue;
    }
    if (column[y] == 1 && row[x] == 1) {
      cout << now << endl;
      continue;
    }
    if (column[y] == 0 && row[x] == 1) {
      column[y] = 1;
      now -= n - used1;
      used2++;
      cout << now << endl;
      continue;
    }
    row[x] = 1;
    now -= n - used2;
    used1++;
    cout << now << endl;
  }
  return 0;
}
