#include <bits/stdc++.h>
using namespace std;
vector<int> h[400000 + 5], v[400000 + 5], d1[400000 + 5], d2[400000 + 5];
int n;
int getd1(int x, int y) { return x + y; }
int getd2(int x, int y) {
  int ret = x > y ? x - y : 2 * n + y - x + 5;
  return ret;
}
int main() {
  int m, t[9] = {0}, x, y;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d", &x);
    scanf("%d", &y);
    h[x].push_back(y);
    v[y].push_back(x);
    d1[getd1(x, y)].push_back(x);
    d2[getd2(x, y)].push_back(x);
  }
  for (int i = 0; i < 400000 + 5; i++) {
    sort((h[i]).begin(), (h[i]).end());
    sort((v[i]).begin(), (v[i]).end());
    sort((d1[i]).begin(), (d1[i]).end());
    sort((d2[i]).begin(), (d2[i]).end());
  }
  for (int i = 0; i < 400000 + 5; i++) {
    for (int j = 0; j < h[i].size(); j++) {
      int curr = (j == 0 || j + 1 == h[i].size()) ? 1 : 2;
      if (h[i].size() == 1) curr = 0;
      x = i;
      y = h[i][j];
      if (v[y].size() == 1)
        curr = curr;
      else if (v[y].front() == x || v[y].back() == x)
        curr++;
      else
        curr += 2;
      y = getd1(x, h[i][j]);
      if (d1[y].size() == 1)
        curr = curr;
      else if (d1[y].front() == x || d1[y].back() == x)
        curr++;
      else
        curr += 2;
      y = getd2(x, h[i][j]);
      if (d2[y].size() == 1)
        curr = curr;
      else if (d2[y].front() == x || d2[y].back() == x)
        curr++;
      else
        curr += 2;
      t[curr]++;
    }
  }
  for (int i = 0; i <= 8; i++) printf("%d ", t[i]);
  return 0;
}
