#include <bits/stdc++.h>
using namespace std;
int n, x1[110000], y11[110000], m, ans[110000],
    counter = 0, row[110000], col[110000], row_beg[110000], col_beg[110000],
    row_end[110000], col_end[110000];
int ans1[10];
map<pair<int, int>, int> m1;
vector<vector<int> > v(210000);
vector<vector<pair<int, int> > > v1(210000);
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    row_beg[i] = n + 1;
    col_beg[i] = n + 1;
    row_end[i] = -1;
    col_end[i] = -1;
  }
  for (int i = 0; i < m; i++) {
    cin >> x1[i] >> y11[i];
    row[x1[i]]++;
    col[y11[i]]++;
    row_beg[x1[i]] = min(row_beg[x1[i]], y11[i]);
    row_end[x1[i]] = max(row_end[x1[i]], y11[i]);
    col_beg[y11[i]] = min(col_beg[y11[i]], x1[i]);
    col_end[y11[i]] = max(col_end[y11[i]], x1[i]);
    m1[make_pair(x1[i], y11[i])] = counter;
    v[(x1[i] + y11[i] - 1)].push_back(x1[i]);
    int offset = 0;
    if (x1[i] <= y11[i]) {
      int diff = y11[i] - (x1[i] - 1);
      offset += (n + 1 - diff);
    } else {
      int diff = x1[i] - (y11[i] - 1);
      offset += (n);
      offset += (diff - 1);
    }
    v1[offset].push_back(make_pair(x1[i], y11[i]));
    counter++;
  }
  for (int i = 1; i <= 2 * n - 1; i++) {
    if (v[i].size() <= 1) continue;
    sort(v[i].begin(), v[i].end());
    for (int j = 0; j < v[i].size(); j++) {
      int temp = m1[make_pair(v[i][j], i + 1 - v[i][j])];
      ans[temp]++;
      if (j != 0 and j != v[i].size() - 1) ans[temp]++;
    }
  }
  for (int i = 1; i <= 2 * n - 1; i++) {
    if (v1[i].size() <= 1) continue;
    sort(v1[i].begin(), v1[i].end());
    for (int j = 0; j < v1[i].size(); j++) {
      int addr = m1[v1[i][j]];
      ans[addr]++;
      if (j != 0 and j != v1[i].size() - 1) ans[addr]++;
    }
  }
  for (int i = 0; i < m; i++) {
    int temp = m1[make_pair(x1[i], y11[i])];
    if (row[x1[i]] > 1) ans[temp]++;
    if (col[y11[i]] > 1) ans[temp]++;
    if (row[x1[i]] > 2 and row_beg[x1[i]] != y11[i] and
        row_end[x1[i]] != y11[i])
      ans[temp]++;
    if (col[y11[i]] > 2 and col_beg[y11[i]] != x1[i] and
        col_end[y11[i]] != x1[i])
      ans[temp]++;
    ans1[ans[temp]]++;
  }
  for (int i = 0; i < 9; i++) cout << ans1[i] << " ";
  cout << "\n";
}
