#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
template <class T>
inline T gcd(T a, T b) {
  long long t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T, typename S>
T expo(T b, S e, const T &m) {
  if (e <= 1) return e == 0 ? 1 : b;
  return (e & 1) == 0 ? expo((b * b) % m, e >> 1, m)
                      : (b * expo((b * b) % m, e >> 1, m)) % m;
}
template <typename T>
T modinv(T a) {
  return expo(a, mod - 2, mod);
}
inline int nextint() {
  int x;
  scanf("%d", &x);
  return x;
}
inline long long nextll() {
  long long x;
  scanf("%lld", &x);
  return x;
}
const long long mx_ll = numeric_limits<long long>::max();
const int mx_int = numeric_limits<int>::max();
const long double PI = (long double)(3.1415926535897932384626433832795);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  set<long long> hori, verti;
  long long ans = n * n;
  while (m--) {
    long long x, y;
    cin >> x >> y;
    hori.insert(x);
    verti.insert(y);
    long long marked_cnt = hori.size() * 1ll * n + verti.size() * 1ll * n -
                           hori.size() * 1ll * verti.size();
    long long fans = ans - marked_cnt;
    cout << fans << "\n";
  }
  return 0;
}
