#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2) res *= a;
    a *= a;
    n /= 2;
  }
  return res;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
void vout(T s) {
  cout << s << "\n";
  exit(0);
}
const long long shl = 1;
const long long MAXN = 1123456;
vector<long long> v[MAXN];
set<pair<long long, long long> > st;
set<long long> s, s1;
map<string, long long> mp;
string s2, s3;
char cc;
long long a[MAXN];
long long bl[MAXN], c, sc, n, m, i, j, dp[MAXN], b[MAXN], a1, b1, c1, ans, x, k;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  while (m--) {
    cin >> a1 >> b1;
    s.insert(a1);
    s1.insert(b1);
    a1 = s.size();
    b1 = s1.size();
    ans = n * (a1 + b1);
    ans -= (a1 * b1);
    cout << n * n - ans << " ";
  }
  cout << "\n";
  return 0;
}
