#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > G;
int rows[200015][2], cols[200015][2], leftright[200015][2],
    rightleft[200015][2];
int queens[200015][2], ans[10];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, r, c;
  cin >> n >> m;
  for (int i = 1; i <= 2 * n; ++i)
    rows[i][0] = cols[i][0] = leftright[i][0] = rightleft[i][0] = INT_MAX;
  for (int i = 0; i < m; ++i) {
    cin >> r >> c;
    rows[r][0] = min(rows[r][0], c);
    rows[r][1] = max(rows[r][1], c);
    cols[c][0] = min(cols[c][0], r);
    cols[c][1] = max(cols[c][1], r);
    leftright[r - c + n][0] = min(leftright[r - c + n][0], r);
    leftright[r - c + n][1] = max(leftright[r - c + n][1], r);
    queens[i][0] = r;
    queens[i][1] = c;
    c = n - c + 1;
    rightleft[r - c + n][0] = min(rightleft[r - c + n][0], r);
    rightleft[r - c + n][1] = max(rightleft[r - c + n][1], r);
  }
  for (int i = 0; i < m; ++i) {
    r = queens[i][0];
    c = queens[i][1];
    int current = 0;
    current += c > rows[r][0];
    current += c < rows[r][1];
    current += r > cols[c][0];
    current += r < cols[c][1];
    current += r > leftright[r - c + n][0];
    current += r < leftright[r - c + n][1];
    c = n - c + 1;
    current += r > rightleft[r - c + n][0];
    current += r < rightleft[r - c + n][1];
    ++ans[current];
  }
  for (int i = 0; i < 9; ++i) cout << ans[i] << ' ';
}
