#include <bits/stdc++.h>
using namespace std;
int x[100000 + 50], y[100000 + 50];
vector<int> rtol[300000 + 50];
vector<int> ltor[300000 + 50], nltor[300000 + 50];
vector<int> row[100000 + 50], col[100000 + 50];
int ans[10];
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x[i] >> y[i];
    row[x[i]].push_back(y[i]);
    col[y[i]].push_back(x[i]);
    rtol[x[i] + y[i]].push_back(y[i]);
    if (x[i] - y[i] >= 0) {
      ltor[x[i] - y[i]].push_back(y[i]);
    } else {
      nltor[y[i] - x[i]].push_back(y[i]);
    }
  }
  for (int i = 0; i <= 2 * n - 1; i++) {
    sort(ltor[i].begin(), ltor[i].end());
    sort(nltor[i].begin(), nltor[i].end());
    sort(rtol[i].begin(), rtol[i].end());
  }
  for (int i = 0; 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 bc = 0;
    int rowsize = row[x[i]].size();
    if (rowsize == 1) {
    } else {
      int index = lower_bound(row[x[i]].begin(), row[x[i]].end(), y[i]) -
                  row[x[i]].begin();
      if (index == 0) {
        bc++;
      } else if (index == rowsize - 1) {
        bc++;
      } else {
        bc += 2;
      }
    }
    int colsize = col[y[i]].size();
    if (colsize == 1) {
    } else {
      int index = lower_bound(col[y[i]].begin(), col[y[i]].end(), x[i]) -
                  col[y[i]].begin();
      if (index == 0 || index == colsize - 1) {
        bc++;
      } else {
        bc += 2;
      }
    }
    int diagsize = rtol[x[i] + y[i]].size();
    if (diagsize == 1) {
    } else {
      int index = lower_bound(rtol[x[i] + y[i]].begin(),
                              rtol[x[i] + y[i]].end(), y[i]) -
                  rtol[x[i] + y[i]].begin();
      if (index == 0 || index == diagsize - 1) {
        bc++;
      } else {
        bc += 2;
      }
    }
    if (x[i] - y[i] >= 0) {
      diagsize = ltor[x[i] - y[i]].size();
      if (diagsize == 1) {
      } else {
        int index = lower_bound(ltor[x[i] - y[i]].begin(),
                                ltor[x[i] - y[i]].end(), y[i]) -
                    ltor[x[i] - y[i]].begin();
        if (index == 0 || index == diagsize - 1) {
          bc++;
        } else {
          bc += 2;
        }
      }
    } else {
      diagsize = nltor[-x[i] + y[i]].size();
      if (diagsize == 1) {
      } else {
        int index = lower_bound(nltor[-x[i] + y[i]].begin(),
                                nltor[-x[i] + y[i]].end(), y[i]) -
                    nltor[-x[i] + y[i]].begin();
        if (index == 0 || index == diagsize - 1) {
          bc++;
        } else {
          bc += 2;
        }
      }
    }
    ans[bc]++;
  }
  for (int i = 0; i <= 8; i++) {
    cout << ans[i] << " ";
  }
  return 0;
}
