#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
int n, m;
vector<pair<int, int>> p;
map<pair<int, int>, int> mp;
int ans[maxn];
vector<pair<int, int>> r[maxn];
vector<pair<int, int>> c[maxn];
vector<pair<int, int>> d1[maxn * 2];
vector<pair<int, int>> d2[maxn * 2];
int cnt[10];
bool cmp1(pair<int, int> a, pair<int, int> b) { return (a.second < b.second); }
bool cmp2(pair<int, int> a, pair<int, int> b) { return (a.first < b.first); }
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    p.push_back({x, y});
    mp[{x, y}] = i;
    r[x].push_back({x, y});
    c[y].push_back({x, y});
    d1[x + y].push_back({x, y});
    d2[x - y + n].push_back({x, y});
  }
  for (int i = 0; i < n * 4 + 5; i++) {
    sort(r[i].begin(), r[i].end(), cmp1);
    sort(c[i].begin(), c[i].end(), cmp2);
    sort(d1[i].begin(), d1[i].end(), cmp2);
    sort(d2[i].begin(), d2[i].end(), cmp2);
  }
  for (int i = 0; i < n * 4 + 5; i++) {
    if (r[i].size() > 1) ans[mp[r[i][0]]]++;
    if (r[i].size() > 1) {
      ans[mp[r[i][r[i].size() - 1]]]++;
    }
    if (r[i].size() > 2) {
      for (int j = 1; j < r[i].size() - 1; j++) ans[mp[r[i][j]]] += 2;
    }
    if (c[i].size() > 1) ans[mp[c[i][0]]]++;
    if (c[i].size() > 1) {
      ans[mp[c[i][c[i].size() - 1]]]++;
    }
    if (c[i].size() > 2) {
      for (int j = 1; j < c[i].size() - 1; j++) ans[mp[c[i][j]]] += 2;
    }
    if (d1[i].size() > 1) ans[mp[d1[i][0]]]++;
    if (d1[i].size() > 1) {
      ans[mp[d1[i][d1[i].size() - 1]]]++;
    }
    if (d1[i].size() > 2) {
      for (int j = 1; j < d1[i].size() - 1; j++) ans[mp[d1[i][j]]] += 2;
    }
    if (d2[i].size() > 1) ans[mp[d2[i][0]]]++;
    if (d2[i].size() > 1) {
      ans[mp[d2[i][d2[i].size() - 1]]]++;
    }
    if (d2[i].size() > 2) {
      for (int j = 1; j < d2[i].size() - 1; j++) ans[mp[d2[i][j]]] += 2;
    }
  }
  for (int i = 0; i < m; i++) {
    cnt[ans[mp[p[i]]]]++;
  }
  for (int i = 0; i < 9; i++) cout << cnt[i] << " ";
  return 0;
}
