#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18 + 7;
const int maxN = 1e6 + 5;
const long long MOD = 1e9 + 7;
int n, m, a, b;
vector<pair<int, int> > rows[maxN], cols[maxN], diagRight[maxN], diagLeft[maxN],
    queens;
map<pair<int, int>, int> ans;
int res[10];
void process(vector<pair<int, int> > vec) {
  sort(vec.begin(), vec.end());
  for (int i = (0); i <= (((int)vec.size() - 1) - 1); ++i) {
    ans[vec[i]]++;
    ans[vec[i + 1]]++;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = (0); i <= ((m)-1); ++i) {
    cin >> a >> b;
    pair<int, int> p = pair<int, int>(a, b);
    rows[a].push_back(p);
    cols[b].push_back(p);
    int d = min(a, b) - 1;
    int x = a - d;
    int y = b - d;
    if (x >= y)
      diagRight[x].push_back(p);
    else
      diagRight[n + y - 1].push_back(p);
    d = min(n - a, b - 1);
    x = a + d;
    y = b - d;
    diagLeft[x + y - 1].push_back(p);
    queens.push_back(p);
  }
  for (int i = (1); i <= ((2 * n)); ++i) {
    process(rows[i]);
    process(cols[i]);
    process(diagRight[i]);
    process(diagLeft[i]);
  }
  for (auto p : queens) {
    res[ans[p]]++;
  }
  for (int i = (0); i <= ((9) - 1); ++i) cout << res[i] << " ";
  return 0;
}
