#include <bits/stdc++.h>
using namespace std;
const int CONST = 1e5;
int n, m;
vector<pair<int, int> > diag1[2 * CONST + 77], diag2[2 * CONST + 77];
vector<int> X[2 * CONST + 77], Y[2 * CONST + 77];
int x[CONST + 77], y[CONST + 77];
int cnt[10];
int check_for_x(int x, int y) {
  if (X[x].size() == 1) return 0;
  if (X[x].size() == 2) return 1;
  if (X[x][0] == y || X[x][X[x].size() - 1] == y) return 1;
  return 2;
}
int check_for_y(int x, int y) {
  if (Y[y].size() == 1) return 0;
  if (Y[y].size() == 2) return 1;
  if (Y[y][0] == x || Y[y][Y[y].size() - 1] == x) return 1;
  return 2;
}
int check_for_1(int x, int y) {
  int dif = x - y + CONST;
  if (diag1[dif].size() == 1) return 0;
  if (diag1[dif].size() == 2) return 1;
  if (diag1[dif][0] == make_pair(x, y) ||
      diag1[dif][diag1[dif].size() - 1] == make_pair(x, y))
    return 1;
  return 2;
}
int check_for_2(int x, int y) {
  int dif = x - (n - y + 1) + CONST;
  if (diag2[dif].size() == 1) return 0;
  if (diag2[dif].size() == 2) return 1;
  if (diag2[dif][0] == make_pair(x, y) ||
      diag2[dif][diag2[dif].size() - 1] == make_pair(x, y))
    return 1;
  return 2;
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x[i] >> y[i];
    X[x[i]].push_back(y[i]);
    Y[y[i]].push_back(x[i]);
    diag1[x[i] - y[i] + CONST].push_back({x[i], y[i]});
    int yy = n - y[i] + 1;
    diag2[x[i] - yy + CONST].push_back({x[i], y[i]});
  }
  for (int i = 1; i <= 2 * CONST; i++) {
    sort(diag1[i].begin(), diag1[i].end());
    sort(diag2[i].begin(), diag2[i].end());
    if (i <= CONST) {
      sort(X[i].begin(), X[i].end());
      sort(Y[i].begin(), Y[i].end());
    }
  }
  for (int i = 1; i <= m; i++) {
    int ans = 0;
    ans += check_for_x(x[i], y[i]);
    ans += check_for_y(x[i], y[i]);
    ans += check_for_1(x[i], y[i]);
    ans += check_for_2(x[i], y[i]);
    cnt[ans]++;
  }
  for (int i = 0; i <= 8; i++) {
    cout << cnt[i] << ' ';
  }
}
