#include <bits/stdc++.h>
using namespace std;
set<int> vertical[100000 + 10], horizontal[100000 + 10], incline[200000 + 10],
    decline[200000 + 10];
int queen[10];
int main() {
  int r, c, n, m;
  pair<int, int> v[100000 + 10];
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &r, &c);
    v[i] = make_pair(r, c);
    vertical[c].insert(r);
    horizontal[r].insert(c);
    incline[c + r - 1].insert(r);
    decline[c + n - r].insert(r);
  }
  for (int i = 1; i <= m; i++) {
    int ans = 0;
    r = v[i].first;
    c = v[i].second;
    if (*vertical[c].begin() < r) ans++;
    if (*vertical[c].rbegin() > r) ans++;
    if (*horizontal[r].begin() < c) ans++;
    if (*horizontal[r].rbegin() > c) ans++;
    if (*incline[c + r - 1].begin() < r) ans++;
    if (*incline[c + r - 1].rbegin() > r) ans++;
    if (*decline[c + n - r].begin() < r) ans++;
    if (*decline[c + n - r].rbegin() > r) ans++;
    queen[ans]++;
  }
  for (int i = 0; i <= 8; i++) printf("%d ", queen[i]);
  cout << endl;
  return 0;
}
