#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  int m;
  cin >> n >> m;
  int arr[9];
  for (int i = 0; i < 9; i++) arr[i] = 0;
  vector<map<int, int> > row(n + 1);
  vector<map<int, int> > col(n + 1);
  vector<map<int, int> > dia1(2 * n);
  vector<map<int, int> > dia2(2 * n);
  vector<pair<int, int> > aa(m + 1);
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    row[x][y]++;
    col[y][x]++;
    dia1[x + y - 1][x - y]++;
    dia2[x - y + n][x + y]++;
    aa[i + 1] = make_pair(x, y);
  }
  map<int, int>::iterator i1;
  map<int, int>::reverse_iterator i2;
  for (int i = 1; i <= m; i++) {
    int count = 0;
    int x, y;
    x = aa[i].first;
    y = aa[i].second;
    i1 = row[x].begin();
    i2 = row[x].rbegin();
    if (i1->first < y) count++;
    if (i2->first > y) count++;
    i1 = col[y].begin();
    i2 = col[y].rbegin();
    if (i1->first < x) count++;
    if (i2->first > x) count++;
    i1 = dia1[x + y - 1].begin();
    i2 = dia1[x + y - 1].rbegin();
    if (i1->first < (x - y)) count++;
    if (i2->first > (x - y)) count++;
    i1 = dia2[x - y + n].begin();
    i2 = dia2[x - y + n].rbegin();
    if (i1->first < (x + y)) count++;
    if (i2->first > (x + y)) count++;
    arr[count]++;
  }
  for (int i = 0; i <= 8; i++) {
    cout << arr[i] << " ";
  }
  cout << '\n';
}
