#include <bits/stdc++.h>
using namespace std;
void printvector(std::vector<long long> v) {
  for (long long i = 0; i < v.size(); ++i) {
    cout << v[i] << " ";
  }
  cout << "" << endl;
}
void printarray(long long a[], long long n) {
  for (long long i = 0; i < n; ++i) {
    cout << a[i] << " ";
  }
  cout << "" << endl;
}
void pri(map<long long, pair<long long, long long> > m) {
  cout << "**********" << endl;
  for (auto it : m) {
    cout << it.first << " " << it.second.first << " " << it.second.second
         << endl;
  }
  cout << "**********" << endl;
}
void solve() {
  long long n, m;
  cin >> n >> m;
  std::vector<pair<long long, long long> > v;
  map<long long, pair<long long, long long> > mix, miy, miyminusx, miyaddx;
  map<long long, pair<long long, long long> > ma_x, may, mayminusx, mayaddx;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    a--;
    b--;
    v.push_back(make_pair(a, b));
    if (mix.find(a) == mix.end() || mix[a].second > b) mix[a] = v[i];
    if (ma_x.find(a) == ma_x.end() || ma_x[a].second < b) ma_x[a] = v[i];
    if (miy.find(b) == miy.end() || miy[b].first > a) miy[b] = v[i];
    if (may.find(b) == may.end() || may[b].first < a) may[b] = v[i];
    if (miyminusx.find(b - a) == miyminusx.end() || miyminusx[b - a].first > a)
      miyminusx[b - a] = v[i];
    if (mayminusx.find(b - a) == mayminusx.end() || mayminusx[b - a].first < a)
      mayminusx[b - a] = v[i];
    if (miyaddx.find(b + a) == miyaddx.end() || miyaddx[b + a].first > a)
      miyaddx[b + a] = v[i];
    if (mayaddx.find(b + a) == mayaddx.end() || mayaddx[b + a].first < a)
      mayaddx[b + a] = v[i];
  }
  std::vector<long long> ans(9, 0);
  for (long long i = 0; i < m; i++) {
    long long a = v[i].first, b = v[i].second;
    long long g = 0;
    if (mix[a] != v[i]) g++;
    if (ma_x[a] != v[i]) g++;
    if (may[b] != v[i]) g++;
    if (miy[b] != v[i]) g++;
    if (miyminusx[b - a] != v[i]) g++;
    if (mayminusx[b - a] != v[i]) g++;
    if (miyaddx[b + a] != v[i]) g++;
    if (mayaddx[b + a] != v[i]) g++;
    ans[g]++;
  }
  printvector(ans);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
