#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int m, n;
  cin >> n >> m;
  long long int row = n, col = n, r[n], c[n], s = n * n, s_arr[m];
  for (int i = 0; i < n; i++) {
    r[i] = 0;
    c[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    long long int a, b;
    cin >> a >> b;
    if (r[a - 1] == 0 && c[b - 1] == 0) {
      r[a - 1] = 1;
      c[b - 1] = 1;
      s = s - (row + col - 1);
      row--;
      col--;
      s_arr[i] = s;
    } else if (r[a - 1] == 0 && c[b - 1] != 0) {
      r[a - 1] = 1;
      s = s - row;
      col--;
      s_arr[i] = s;
    } else if (r[a - 1] != 0 && c[b - 1] == 0) {
      c[b - 1] = 1;
      s = s - col;
      row--;
      s_arr[i] = s;
    } else if (r[a - 1] != 0 && c[b - 1] != 0) {
      s_arr[i] = s;
    }
  }
  for (int i = 0; i < m; i++) {
    cout << s_arr[i] << " ";
  }
}
