#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
const int N = 1e5;
int n, m, t[9];
int32_t r[N], c[N];
int8_t a[N];
vector<int32_t> b[4][2 * N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> r[i] >> c[i];
    b[0][r[i] - 1].push_back(i);
    b[1][c[i] - 1].push_back(i);
    b[2][r[i] + c[i] - 2].push_back(i);
    b[3][r[i] - c[i] + n - 1].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    auto& bb = b[0][i];
    sort(bb.begin(), bb.end(), [](int i, int j) { return c[i] < c[j]; });
    for (size_t j = 1; j < bb.size(); j++) a[bb[j - 1]]++, a[bb[j]]++;
  }
  for (int i = 0; i < n; i++) {
    auto& bb = b[1][i];
    sort(bb.begin(), bb.end(), [](int i, int j) { return r[i] < r[j]; });
    for (size_t j = 1; j < bb.size(); j++) a[bb[j - 1]]++, a[bb[j]]++;
  }
  for (int i = 0; i < 2 * n; i++) {
    auto& bb = b[2][i];
    sort(bb.begin(), bb.end(), [](int i, int j) { return r[i] < r[j]; });
    for (size_t j = 1; j < bb.size(); j++) a[bb[j - 1]]++, a[bb[j]]++;
  }
  for (int i = 0; i < 2 * n; i++) {
    auto& bb = b[3][i];
    sort(bb.begin(), bb.end(), [](int i, int j) { return r[i] < r[j]; });
    for (size_t j = 1; j < bb.size(); j++) a[bb[j - 1]]++, a[bb[j]]++;
  }
  for (int i = 0; i < m; i++) t[a[i]]++;
  for (int i = 0; i < 9; i++) cout << t[i] << (i == 8 ? '\n' : ' ');
  return 0;
}
