#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  bool bowl[N];
  int grain = N;
  int tea = N;
  bool cup[tea];
  while (grain > 0) {
    tea--;
    grain--;
    bowl[grain] = false;
    ;
    cup[tea] = false;
    ;
  }
  int other_grain = N;
  tea = N;
  int noodle;
  long long bowlspace = N;
  long long cupspace = tea;
  cin >> other_grain;
  while (other_grain > 0) {
    other_grain--;
    cin >> noodle;
    cin >> tea;
    noodle--;
    tea--;
    if (bowl[noodle] == true) {
      N = N;
    } else {
      bowl[noodle] = true;
      bowlspace--;
    }
    if (cup[tea] == true) {
      N = N;
    } else {
      cup[tea] = true;
      cupspace--;
    }
    cout << cupspace * bowlspace << endl;
  }
}
