#include <bits/stdc++.h>
using namespace std;
int minR[200010], maxR[200010], minC[200010], maxC[200010], minD1[200010],
    maxD1[200010], minD2[200010], maxD2[200010];
int n, m;
int pos[200010][2];
int main() {
  cin >> n >> m;
  memset(minR, 200010, sizeof(minR));
  memset(maxR, 0, sizeof(maxR));
  memset(minC, 200010, sizeof(minC));
  memset(maxC, 0, sizeof(maxC));
  memset(minD1, 200010, sizeof(minD1));
  memset(maxD1, 0, sizeof(maxD1));
  memset(minD2, 200010, sizeof(minD2));
  memset(maxD2, 0, sizeof(maxD2));
  for (int i = 0; i < m; ++i) {
    int r, c;
    cin >> r >> c;
    r--;
    c--;
    pos[i][0] = r;
    pos[i][1] = c;
    minR[r] = min(c, minR[r]);
    maxR[r] = max(c, maxR[r]);
    minC[c] = min(r, minC[c]);
    maxC[c] = max(r, maxC[c]);
    minD1[r + c] = min(r, minD1[r + c]);
    maxD1[r + c] = max(r, maxD1[r + c]);
    minD2[r - c + n] = min(r, minD2[r - c + n]);
    maxD2[r - c + n] = max(r, maxD2[r - c + n]);
  }
  int res[9];
  memset(res, 0, sizeof(res));
  for (int i = 0; i < m; ++i) {
    int r, c;
    r = pos[i][0];
    c = pos[i][1];
    int count = 0;
    if (r > minC[c] && r < maxC[c])
      count += 2;
    else if (r > minC[c] || r < maxC[c])
      count++;
    if (c > minR[r] && c < maxR[r])
      count += 2;
    else if (c > minR[r] || c < maxR[r])
      count++;
    if (r > minD1[r + c] && r < maxD1[r + c])
      count += 2;
    else if (r > minD1[r + c] || r < maxD1[r + c])
      count++;
    if (r > minD2[r - c + n] && r < maxD2[r - c + n])
      count += 2;
    else if (r > minD2[r - c + n] || r < maxD2[r - c + n])
      count++;
    res[count]++;
  }
  for (int i = 0; i < 9; ++i) cout << res[i] << " ";
  return 0;
}
