#include <bits/stdc++.h>
using namespace std;
vector<int> row[100009];
vector<int> col[100009];
vector<int> diag1[100009 * 4];
vector<int> diag2[100009 * 4];
vector<pair<int, int> > queen;
vector<int>::iterator low, up;
int resp[16];
int main(void) {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  memset(resp, 0, sizeof(resp));
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    queen.push_back(make_pair(x, y));
    row[x].push_back(y);
    col[y].push_back(x);
    diag1[x + y + 200009].push_back(x - y + 200009);
    diag2[x - y + 200009].push_back(x + y + 200009);
  }
  for (int i = -200000 + 200009; i <= 200000 + 200009; i++) {
    sort(diag1[i].begin(), diag1[i].end());
    sort(diag2[i].begin(), diag2[i].end());
  }
  for (int i = 1; i <= n; i++) {
    sort(row[i].begin(), row[i].end());
    sort(col[i].begin(), col[i].end());
  }
  for (int i = 0; i < m; i++) {
    int x = queen[i].first;
    int y = queen[i].second;
    int cnt = 0;
    low = lower_bound(row[x].begin(), row[x].end(), y);
    int pos = int(low - row[x].begin());
    if (pos > 0) cnt++;
    if (pos < row[x].size() - 1) cnt++;
    low = lower_bound(col[y].begin(), col[y].end(), x);
    pos = int(low - col[y].begin());
    if (pos > 0) cnt++;
    if (pos < col[y].size() - 1) cnt++;
    low = lower_bound(diag1[x + y + 200009].begin(),
                      diag1[x + y + 200009].end(), x - y + 200009);
    pos = int(low - diag1[x + y + 200009].begin());
    if (pos > 0) cnt++;
    if (pos < diag1[x + y + 200009].size() - 1) cnt++;
    low = lower_bound(diag2[x - y + 200009].begin(),
                      diag2[x - y + 200009].end(), x + y + 200009);
    pos = int(low - diag2[x - y + 200009].begin());
    if (pos > 0) cnt++;
    if (pos < diag2[x - y + 200009].size() - 1) cnt++;
    resp[cnt]++;
  }
  for (int i = 0; i <= 8; i++) {
    if (i) printf(" ");
    printf("%d", resp[i]);
  }
  return 0;
}
