#include <bits/stdc++.h>
static inline int popcount(int x) { return __builtin_popcount(x); }
template <class T, class U>
static inline std::pair<T, U> mp(const T& a, const U& b) {
  return std::make_pair(a, b);
}
static constexpr int INF = std::numeric_limits<int>::max();
int main() {
  int size, queens;
  std::scanf("%d %d", &size, &queens);
  std::vector<std::vector<int>> rboard(size);
  std::vector<std::vector<int>> cboard(size);
  std::unordered_map<int, std::vector<int>> diags1, diags2;
  std::vector<std::pair<int, int>> loc(queens);
  for (int i = 0; i < queens; i++) {
    int row, col;
    std::scanf("%d %d", &row, &col);
    row--, col--;
    loc[i] = std::pair<int, int>(row, col);
    rboard[row].push_back(col);
    cboard[col].push_back(row);
    row++, col++;
    diags1[row + col].push_back(col);
    diags2[row - col].push_back(col);
  }
  for (int i = 0; i < size; i++) {
    std::sort(rboard[i].begin(), rboard[i].end());
    std::sort(cboard[i].begin(), cboard[i].end());
  }
  for (auto& itr : diags1) std::sort(itr.second.begin(), itr.second.end());
  for (auto& itr : diags2) std::sort(itr.second.begin(), itr.second.end());
  int freq[9] = {0};
  for (int i = 0; i < queens; i++) {
    int a = loc[i].first, b = loc[i].second;
    int gu = 0;
    auto itr = std::upper_bound(rboard[a].begin(), rboard[a].end(), b);
    if (itr != rboard[a].end()) gu++;
    itr--;
    if (itr != rboard[a].begin()) gu++;
    itr = std::upper_bound(cboard[b].begin(), cboard[b].end(), a);
    if (itr != cboard[b].end()) gu++;
    itr--;
    if (itr != cboard[b].begin()) gu++;
    a++, b++;
    const int d1 = a + b;
    const int d2 = a - b;
    itr = std::upper_bound(diags1[d1].begin(), diags1[d1].end(), b);
    if (itr != diags1[d1].end()) gu++;
    itr--;
    if (itr != diags1[d1].begin()) gu++;
    itr = std::upper_bound(diags2[d2].begin(), diags2[d2].end(), b);
    if (itr != diags2[d2].end()) gu++;
    itr--;
    if (itr != diags2[d2].begin()) {
      gu++;
    }
    freq[gu]++;
  }
  for (int i = 0; i <= 8; i++) {
    if (i != 0) std::putchar(' ');
    std::printf("%d", freq[i]);
  }
  std::putchar('\n');
  return 0;
}
