#include <bits/stdc++.h>
using namespace std;
int n, m;
int ud[100001];
int lr[100001];
int tl[200001];
int tr[200001];
int attk[10];
int num[100001];
pair<pair<int, int>, int> pos[100001];
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 1; i < 1 + m; ++i) {
    scanf("%d", &pos[i].first.first);
    scanf("%d", &pos[i].first.second);
    pos[i].second = i;
  }
  sort(pos + 1, pos + m + 1);
  long long ans = 0;
  for (int i = 1; i < m + 1; ++i) {
    if (ud[pos[i].first.second] != 0) {
      num[ud[pos[i].first.second]]++;
      num[pos[i].second]++;
    }
    ud[pos[i].first.second] = pos[i].second;
  }
  sort(pos + 1, pos + m + 1,
       [](pair<pair<int, int>, int> &a, pair<pair<int, int>, int> &b) {
         return a.first.second < b.first.second;
       });
  for (int i = 1; i < m + 1; ++i) {
    if (lr[pos[i].first.first] != 0) {
      num[lr[pos[i].first.first]]++;
      num[pos[i].second]++;
    }
    lr[pos[i].first.first] = pos[i].second;
  }
  sort(pos + 1, pos + m + 1,
       [](pair<pair<int, int>, int> &a, pair<pair<int, int>, int> &b) {
         return a.first.first + a.first.second < b.first.first + b.first.second;
       });
  for (int i = 1; i < m + 1; ++i) {
    if (tl[100000 + pos[i].first.second - pos[i].first.first] != 0) {
      num[tl[100000 + pos[i].first.second - pos[i].first.first]]++;
      num[pos[i].second]++;
    }
    tl[100000 + pos[i].first.second - pos[i].first.first] = pos[i].second;
  }
  sort(pos + 1, pos + m + 1,
       [](pair<pair<int, int>, int> &a, pair<pair<int, int>, int> &b) {
         return a.first.first - a.first.second < b.first.first - b.first.second;
       });
  for (int i = 1; i < m + 1; ++i) {
    if (tr[pos[i].first.second + pos[i].first.first] != 0) {
      num[tr[pos[i].first.second + pos[i].first.first]]++;
      num[pos[i].second]++;
    }
    tr[pos[i].first.second + pos[i].first.first] = pos[i].second;
  }
  for (int i = 1; i <= m; ++i) attk[num[i]]++;
  for (int i = 0; i <= 8; ++i) cout << attk[i] << " ";
  cout << endl;
  return 0;
}
