#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;

typedef long long ll;
#define ls rt<<1
#define rs rt<<1|1
const int maxn = 2e5 + 10;
const int maxm = 1e6 + 10;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-7;
const int mod=1e9+7;

int x[maxn],y[maxn],c[maxn],r[maxn],lc[maxn],rc[maxn];
int bx[maxn],by[maxn],blc[maxn],brc[maxn],lx[maxn],ly[maxn],llc[maxn],lrc[maxn];
int t[10];
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin>>n>>m;
    cin>>x[1]>>y[1];
    bx[x[1]]=lx[x[1]]=y[1];
    by[y[1]]=ly[y[1]]=x[1];
    blc[x[1]+y[1]]=llc[x[1]+y[1]]=x[1];
    brc[x[1]-y[1]+n]=lrc[x[1]-y[1]+n]=x[1];
    c[x[1]]++; r[y[1]]++; lc[x[1]+y[1]]++; rc[x[1]-y[1]+n]++;
    for(int i=2;i<=m;i++) {
        cin>>x[i]>>y[i];
        c[x[i]]++; r[y[i]]++;
        lc[x[i]+y[i]]++; rc[x[i]-y[i]+n]++;
        bx[x[i]]=max(bx[x[i]],y[i]);
        lx[x[i]]=min(lx[x[i]],y[i]);

        by[y[i]]=max(by[y[i]],x[i]);
        ly[y[i]]=min(ly[y[i]],x[i]);

        blc[x[i]+y[i]]=max(blc[x[i]+y[i]],x[i]);
        llc[x[i]+y[i]]=min(llc[x[i]+y[i]],x[i]);

        brc[x[i]-y[i]+n]=max(brc[x[i]-y[i]+n],x[i]);
        lrc[x[i]-y[i]+n]=min(lrc[x[i]-y[i]+n],x[i]);
    }
    for(int i=1;i<=m;i++) {
        int ans=0;
        if(c[x[i]]==2) ans++;
        if(c[x[i]]>2) {
            if(y[i]==bx[x[i]]||y[i]==lx[x[i]]) ans++;
            else ans+=2;
        }

        if(r[y[i]]==2) ans++;
        if(r[y[i]]>2) {
            if(x[i]==by[y[i]]||x[i]==ly[y[i]]) ans++;
            else ans+=2;
        }

        if(lc[x[i]+y[i]]==2) ans++;
        if(lc[x[i]+y[i]]>2) {
            if(x[i]==blc[x[i]+y[i]]||x[i]==llc[x[i]+y[i]]) ans++;
            else ans+=2;
        }

        if(rc[x[i]-y[i]+n]==2) ans++;
        if(rc[x[i]-y[i]+n]>2) {
            if(x[i]==brc[x[i]-y[i]+n]||x[i]==lrc[x[i]-y[i]+n]) ans++;
            else ans+=2;
        }
        t[ans]++;
    }
    for(int i=0;i<8;i++) cout<<t[i]<<' ';
    cout<<t[8]<<endl;
    return 0;
}


#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;

typedef long long ll;
#define ls rt<<1
#define rs rt<<1|1
const int maxn = 2e5 + 10;
const int maxm = 1e6 + 10;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-7;
const int mod=1e9+7;

int x[maxn],y[maxn],c[maxn],r[maxn],lc[maxn],rc[maxn];
int t[10];
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,bx,lx,by,ly,blc,llc,brc,lrc;
    cin>>n>>m;
    cin>>x[1]>>y[1];
    bx=lx=y[1];
    by=ly=x[1];
    blc=llc=x[1];
    brc=lrc=x[1];
    c[x[1]]++; r[y[1]]++; lc[x[1]+y[1]]++; rc[x[1]-y[1]+n]++;
    for(int i=2;i<=m;i++) {
        cin>>x[i]>>y[i];
        c[x[i]]++; r[y[i]]++;
        lc[x[i]+y[i]]++; rc[x[i]-y[i]+n]++;
        bx=max(bx,y[i]);
        lx=min(lx,y[i]);

        by=max(by,x[i]);
        ly=min(ly,x[i]);

        blc=max(blc,x[i]);
        llc=min(llc,x[i]);

        brc=max(brc,x[i]);
        lrc=min(lrc,x[i]);
    }
    for(int i=1;i<=m;i++) {
        int ans=0;
        if(c[x[i]]==2) ans++;
        if(c[x[i]]>2) {
            if(y[i]==bx||y[i]==lx) ans++;
            else ans+=2;
        }

        if(r[y[i]]==2) ans++;
        if(r[y[i]]>2) {
            if(x[i]==by||x[i]==ly) ans++;
            else ans+=2;
        }

        if(lc[x[i]+y[i]]==2) ans++;
        if(lc[x[i]+y[i]]>2) {
            if(x[i]==blc||x[i]==llc) ans++;
            else ans+=2;
        }

        if(rc[x[i]-y[i]+n]==2) ans++;
        if(rc[x[i]-y[i]+n]>2) {
            if(x[i]==brc||x[i]==lrc) ans++;
            else ans+=2;
        }
        t[ans]++;
    }
    for(int i=0;i<8;i++) cout<<t[i]<<' ';
    cout<<t[8]<<endl;
    return 0;
}


#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;

typedef long long ll;
#define ls rt<<1
#define rs rt<<1|1
const int maxn = 2e5 + 10;
const int maxm = 1e6 + 10;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-7;
const int mod=1e9+7;

int x[maxn],y[maxn],c[maxn],r[maxn],lc[maxn],rc[maxn];
int bx[maxn],by[maxn],blc[maxn],brc[maxn],lx[maxn],ly[maxn],llc[maxn],lrc[maxn];
int t[10];
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<=maxn;i++) {
        bx[i]=by[i]=blc[i]=brc[i]=-inf;
        lx[i]=ly[i]=llc[i]=lrc[i]=inf;
    }
//    cin>>x[1]>>y[1];
//    bx[x[1]]=lx[x[1]]=y[1];
//    by[y[1]]=ly[y[1]]=x[1];
//    blc[x[1]+y[1]]=llc[x[1]+y[1]]=x[1];
//    brc[x[1]-y[1]+n]=lrc[x[1]-y[1]+n]=x[1];
//    c[x[1]]++; r[y[1]]++; lc[x[1]+y[1]]++; rc[x[1]-y[1]+n]++;
    for(int i=1;i<=m;i++) {
        cin>>x[i]>>y[i];
        c[x[i]]++; r[y[i]]++;
        lc[x[i]+y[i]]++; rc[x[i]-y[i]+n]++;
        bx[x[i]]=max(bx[x[i]],y[i]);
        lx[x[i]]=min(lx[x[i]],y[i]);

        by[y[i]]=max(by[y[i]],x[i]);
        ly[y[i]]=min(ly[y[i]],x[i]);

        blc[x[i]+y[i]]=max(blc[x[i]+y[i]],x[i]);
        llc[x[i]+y[i]]=min(llc[x[i]+y[i]],x[i]);

        brc[x[i]-y[i]+n]=max(brc[x[i]-y[i]+n],x[i]);
        lrc[x[i]-y[i]+n]=min(lrc[x[i]-y[i]+n],x[i]);
    }
    for(int i=1;i<=m;i++) {
        int ans=0;
        if(c[x[i]]==2) ans++;
        if(c[x[i]]>2) {
            if(y[i]==bx[x[i]]||y[i]==lx[x[i]]) ans++;
            else ans+=2;
        }

        if(r[y[i]]==2) ans++;
        if(r[y[i]]>2) {
            if(x[i]==by[y[i]]||x[i]==ly[y[i]]) ans++;
            else ans+=2;
        }

        if(lc[x[i]+y[i]]==2) ans++;
        if(lc[x[i]+y[i]]>2) {
            if(x[i]==blc[x[i]+y[i]]||x[i]==llc[x[i]+y[i]]) ans++;
            else ans+=2;
        }

        if(rc[x[i]-y[i]+n]==2) ans++;
        if(rc[x[i]-y[i]+n]>2) {
            if(x[i]==brc[x[i]-y[i]+n]||x[i]==lrc[x[i]-y[i]+n]) ans++;
            else ans+=2;
        }
        t[ans]++;
    }
    for(int i=0;i<8;i++) cout<<t[i]<<' ';
    cout<<t[8]<<endl;
    return 0;
}


#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;

typedef long long ll;
#define ls rt<<1
#define rs rt<<1|1
const int maxn = 2e5 + 10;
const int maxm = 1e6 + 10;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-7;
const int mod=1e9+7;

int x[maxn],y[maxn],c[maxn],r[maxn],lc[maxn],rc[maxn];
int t[10];
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,bx,lx,by,ly,blc,llc,brc,lrc;
    cin>>n>>m;
    cin>>x[1]>>y[1];
    bx=lx=y[1];
    by=ly=x[1];
    blc=llc=x[1];
    brc=lrc=x[1];
    c[x[1]]++; r[y[1]]++; lc[x[1]+y[1]]++; rc[x[1]-y[1]+n]++;
    for(int i=2;i<=m;i++) {
        cin>>x[i]>>y[i];
        c[x[i]]++; r[y[i]]++;
        lc[x[i]+y[i]]++; rc[x[i]-y[i]+n]++;
        bx=max(bx,y[i]);
        lx=min(lx,y[i]);

        by=max(by,x[i]);
        ly=min(ly,x[i]);

        blc=max(blc,x[i]);
        llc=max(llc,x[i]);

        brc=max(brc,x[i]);
        lrc=max(lrc,x[i]);
    }
    for(int i=1;i<=m;i++) {
        int ans=0;
        if(c[x[i]]==2) ans++;
        if(c[x[i]]>2) {
            if(y[i]==bx||y[i]==lx) ans++;
            else ans+=2;
        }

        if(r[y[i]]==2) ans++;
        if(r[y[i]]>2) {
            if(x[i]==by||x[i]==ly) ans++;
            else ans+=2;
        }

        if(lc[x[i]+y[i]]==2) ans++;
        if(lc[x[i]+y[i]]>2) {
            if(x[i]==blc||x[i]==llc) ans++;
            else ans+=2;
        }

        if(rc[x[i]-y[i]+n]==2) ans++;
        if(rc[x[i]-y[i]+n]>2) {
            if(x[i]==brc||x[i]==lrc) ans++;
            else ans+=2;
        }
        t[ans]++;
    }
    for(int i=0;i<8;i++) cout<<t[i]<<' ';
    cout<<t[8]<<endl;
    return 0;
}


#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
using namespace std;

typedef long long ll;
#define ls rt<<1
#define rs rt<<1|1
const int maxn = 2e5 + 10;
const int maxm = 1e6 + 10;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3fLL;
const double eps=1e-7;
const int mod=1e9+7;

int x[maxn],y[maxn],c[maxn],r[maxn],lc[maxn],rc[maxn];
int t[10];
int main()
{
#ifdef local
    freopen("input.txt","r",stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m,bx,lx,by,ly,blc,llc,brc,lrc;
    cin>>n>>m;
    cin>>x[1]>>y[1];
    bx=lx=x[1];
    by=ly=y[1];
    blc=llc=x[1];
    brc=lrc=x[1];
    c[x[1]]++; r[y[1]]++; lc[x[1]+y[1]]++; rc[x[1]-y[1]+n]++;
    for(int i=2;i<=m;i++) {
        cin>>x[i]>>y[i];
        c[x[i]]++; r[y[i]]++;
        lc[x[i]+y[i]]++; rc[x[i]-y[i]+n]++;
        bx=max(bx,y[i]);
        lx=min(lx,y[i]);

        by=max(by,x[i]);
        ly=min(ly,x[i]);

        blc=max(blc,x[i]);
        llc=max(llc,x[i]);

        brc=max(brc,x[i]);
        lrc=max(lrc,x[i]);
    }
    for(int i=1;i<=m;i++) {
        int ans=0;
        if(c[x[i]]==2) ans++;
        if(c[x[i]]>2) {
            if(y[i]==bx||y[i]==lx) ans++;
            else ans+=2;
        }

        if(r[y[i]]==2) ans++;
        if(r[y[i]]>2) {
            if(x[i]==by||x[i]==ly) ans++;
            else ans+=2;
        }

        if(lc[x[i]+y[i]]==2) ans++;
        if(lc[x[i]+y[i]]>2) {
            if(x[i]==blc||x[i]==llc) ans++;
            else ans+=2;
        }

        if(rc[x[i]-y[i]+n]==2) ans++;
        if(rc[x[i]-y[i]+n]>2) {
            if(x[i]==brc||x[i]==lrc) ans++;
            else ans+=2;
        }
        t[ans]++;
    }
    for(int i=0;i<8;i++) cout<<t[i]<<' ';
    cout<<t[8]<<endl;
    return 0;
}


#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;

#define all(c) (c).begin(),(c).end()
#define endl "\n"
#define ff first
#define ss second
#define allr(c) (c).rbegin(),(c).rend()
#define ifr(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define pof pop_front
#define pob pop_back
#define pb emplace_back
#define pf emplace_front
#define fstm(m,n,r) m.reserve(n);m.max_load_factor(r)
#define mp make_pair
#define mt make_tuple
#define inf LLONG_MAX
#define os tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero).
const double PI = acos(-1);
typedef complex<double> cd;
typedef long long ll;
ll gcd(){return 0ll;} template<typename T,typename... Args> T gcd(T a,Args... args) { return __gcd(a,(__typeof(a))gcd(args...)); }
typedef map<ll,ll> mll;
typedef map<string,ll> msll;
typedef unordered_map<ll,ll> umap;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef long double ld;
#define mod 1000000007
#define N 100001

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif
    // int T;cin>>T;while(T--)
    {
        int n, m, w;
        cin>>n>>m;
        int res[9] = {0};
        pair<int, int> a[m];
        ifr(i,0,m) cin>>a[i].ff>>a[i].ss;
        sort(a, a+m);
        map<int,int> hsuf, vsuf, ldsuf, rdsuf;
        map<int,int> hpre, vpre, ldpre, rdpre;
        ifr(i,0,m) {
            hsuf [a[i].ff]++;
            vsuf [a[i].ss]++;
            ldsuf[a[i].ff+a[i].ss]++;
            rdsuf[a[i].ff-a[i].ss]++;
        }
        ifr(i,0,m) {
            hsuf [a[i].ff]--;
            vsuf [a[i].ss]--;
            ldsuf[a[i].ff+a[i].ss]--;
            rdsuf[a[i].ff-a[i].ss]--;
            w  = (hpre[a[i].ff]>0) + (hsuf[a[i].ff]>0) + (vpre[a[i].ss]>0) + (vsuf[a[i].ss]>0);
            w += (ldpre[a[i].ff+a[i].ss]>0) + (rdpre[a[i].ff-a[i].ss]>0);
            w += (ldsuf[a[i].ff+a[i].ss]>0) + (rdsuf[a[i].ff-a[i].ss]>0);
            res[w]++;
            hpre [a[i].ff]++;
            vpre [a[i].ss]++;
            ldpre[a[i].ff+a[i].ss]++;
            rdpre[a[i].ff-a[i].ss]++;
        }
        ifr(i,0,9) cout<<res[i]<<" "; cout<<endl;
    }
    return 0;
}


#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;

#define all(c) (c).begin(),(c).end()
#define endl "\n"
#define ff first
#define ss second
#define allr(c) (c).rbegin(),(c).rend()
#define ifr(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define pof pop_front
#define pob pop_back
#define pb emplace_back
#define pf emplace_front
#define fstm(m,n,r) m.reserve(n);m.max_load_factor(r)
#define mp make_pair
#define mt make_tuple
#define inf LLONG_MAX
#define os tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero).
const double PI = acos(-1);
typedef complex<double> cd;
typedef long long ll;
ll gcd(){return 0ll;} template<typename T,typename... Args> T gcd(T a,Args... args) { return __gcd(a,(__typeof(a))gcd(args...)); }
typedef map<ll,ll> mll;
typedef map<string,ll> msll;
typedef unordered_map<ll,ll> umap;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef long double ld;
#define mod 1000000007
#define N 100001

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif
    // int T;cin>>T;while(T--)
    {
        int n, m, w;
        cin>>n>>m;
        int res[8] = {0};
        pair<int, int> a[m];
        ifr(i,0,m) cin>>a[i].ff>>a[i].ss;
        sort(a, a+m);
        map<int,int> hsuf, vsuf, ldsuf, rdsuf;
        map<int,int> hpre, vpre, ldpre, rdpre;
        ifr(i,0,m) {
            hsuf [a[i].ff]++;
            vsuf [a[i].ss]++;
            ldsuf[a[i].ff+a[i].ss]++;
            rdsuf[a[i].ff-a[i].ss]++;
        }
        ifr(i,0,m) {
            hsuf [a[i].ff]--;
            vsuf [a[i].ss]--;
            ldsuf[a[i].ff+a[i].ss]--;
            rdsuf[a[i].ff-a[i].ss]--;
            w  = (hpre[a[i].ff]>0) + (hsuf[a[i].ff]>0) + (vpre[a[i].ss]>0) + (vsuf[a[i].ss]>0);
            w += (ldpre[a[i].ff+a[i].ss]>0) + (rdpre[a[i].ff-a[i].ss]>0);
            w += (ldsuf[a[i].ff+a[i].ss]>0) + (rdsuf[a[i].ff-a[i].ss]>0);
            res[w]++;
            hpre [a[i].ff]++;
            vpre [a[i].ss]++;
            ldpre[a[i].ff+a[i].ss]++;
            rdpre[a[i].ff-a[i].ss]++;
        }
        ifr(i,0,8) cout<<res[i]<<" "; cout<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define PI 3.14159265358979323846
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef long double ld;
typedef string st;
const ll MOD = 1e9 + 7 ;
const ll INF=1e14;
ll mpow(ll a,ll b,ll p=MOD){a=a%p;ll res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const ll N=500020;
map<int,vector<pii>> ar;
map<int,vector<pii>> ac;
map<int,vector<pii>> diag1;
map<int,vector<pii>> diag2;
ll o[100][100];
int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n,m;
      cin>>n>>m;
      for(int i=0;i<m;i++)
      {
        int x,y;
        cin>>x>>y;
        o[x-1][y-1]=1;
        ar[x].pb({y,i});
        ac[y].pb({x,i});
        diag1[x-y].pb({y-x,i});
        diag2[y+x].pb({x-y,i});
      }
     // forn(i,n){ forn(j,n) cout<<o[i][j]<<" "; cout<<"\n";}
      int ans[m]={0};
      for(auto b:ar)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }
      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      for(auto b:ac)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }
      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      for(auto b:diag1)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }

      }
      for(auto b:diag2)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }

      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      int cnt[9]={0};
      forn(i,m)
      {
        cnt[ans[i]]++;
        //cout<<ans[i]<<" ";
      }
      forn(i,9)
      {
       cout<<cnt[i]<<" ";
      }
}
// I never lose. I either win or I learn


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define PI 3.14159265358979323846
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef long double ld;
typedef string st;
const ll MOD = 1e9 + 7 ;
const ll INF=1e14;
ll mpow(ll a,ll b,ll p=MOD){a=a%p;ll res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const ll N=500020;
map<int,vector<pii>> ar;
map<int,vector<pii>> ac;
map<int,vector<pii>> diag1;
map<int,vector<pii>> diag2;
int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n,m;
      cin>>n>>m;
      for(int i=0;i<m;i++)
      {
        int x,y;
        cin>>x>>y;
        ar[x].pb({y,i});
        ac[y].pb({x,i});
        diag1[x-y].pb({y+x,i});
        diag2[y+x].pb({x-y,i});
      }
      //forn(i,n){ forn(j,n) cout<<"("<<i<<" "<<j<<")  "; cout<<"\n";}
      int ans[m]={0};
      for(auto b:ar)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }
      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      for(auto b:ac)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }
      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      for(auto b:diag1)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }

      }
      for(auto b:diag2)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }

      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      int cnt[9]={0};
      forn(i,m)
      {
        cnt[ans[i]]++;
        //cout<<ans[i]<<" ";
      }
      forn(i,9)
      {
       cout<<cnt[i]<<" ";
      }
}
// I never lose. I either win or I learn


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<pair<int,int>, null_type, less<pair<int,int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define PI 3.14159265358979323846
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef long double ld;
typedef string st;
const ll MOD = 1e9 + 7 ;
const ll INF=1e14;
ll mpow(ll a,ll b,ll p=MOD){a=a%p;ll res=1;while(b>0){if(b&1)res=(res*a)%p;a=(a*a)%p;b=b>>1;}return res%p;}
const ll N=500020;
map<int,vector<pii>> ar;
map<int,vector<pii>> ac;
map<int,vector<pii>> diag1;
map<int,vector<pii>> diag2;
ll o[100][100];
int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      #endif
      int n,m;
      cin>>n>>m;
      for(int i=0;i<m;i++)
      {
        int x,y;
        cin>>x>>y;
        o[x-1][y-1]=1;
        ar[x].pb({y,i});
        ac[y].pb({x,i});
        diag1[x-y].pb({y+x,i});
        diag2[y+x].pb({x-y,i});
      }
     // forn(i,n){ forn(j,n) cout<<o[i][j]<<" "; cout<<"\n";}
      int ans[m]={0};
      for(auto b:ar)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }
      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      for(auto b:ac)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }
      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      for(auto b:diag1)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }

      }
      for(auto b:diag2)
      {
        vector<pii> v=b.se;
        sort(all(v));
        int sz=(int)v.size();
        for(ll i=0;i<sz-1;i++)
        {
          ans[v[i].se]++;
          ans[v[i+1].se]++;
        }

      }
      //forn(i,m) cout<<ans[i]<<" ";
      //cout<<"\n";
      int cnt[9]={0};
      forn(i,m)
      {
        cnt[ans[i]]++;
        //cout<<ans[i]<<" ";
      }
      forn(i,9)
      {
       cout<<cnt[i]<<" ";
      }
}
// I never lose. I either win or I learn


#include <bits/stdc++.h>

using namespace std;

int x[100010], y[100010];
int n, m;
vector < int > row[100010], col[100010];
vector < int > d1[200010], d2[200010];
const int c = 100000;

bool cmpx(const int &lhs, const int &rhs){
    return x[lhs] < x[rhs];
}

bool cmpy(const int &lhs, const int &rhs){
    return y[lhs] < y[rhs];
}

int main()
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < m; i++){
        scanf("%d%d", x + i, y + i);
        row[x[i]].push_back(i);
        col[y[i]].push_back(i);
        d1[x[i]+y[i]].push_back(i);
        d2[x[i]-y[i]+c].push_back(i);
    }
    for(int i = 1; i <= n; i++){
        sort(row[i].begin(), row[i].end(), cmpx);
        sort(col[i].begin(), col[i].end(), cmpy);
    }
    for(int i = 0; i <= 2 * n; i++){
        sort(d1[i].begin(), d1[i].end(), cmpx);
        sort(d2[i].begin(), d2[i].end(), cmpx);
    }
    int t[9] = {};
    for(int i = 0; i < m; i++){
        int cur = 8;
        if(row[x[i]].front() == i) --cur;
        if(row[x[i]].back() == i) --cur;
        if(col[y[i]].front() == i) --cur;
        if(col[y[i]].back() == i) --cur;
        if(d1[x[i]+y[i]].front() == i) --cur;
        if(d1[x[i]+y[i]].back() == i) --cur;
        if(d2[x[i]-y[i]+c].front() == i) --cur;
        if(d2[x[i]-y[i]+c].back() == i) -- cur;
        t[cur]++;
    }
    for(int i = 0; i <= 8; i++) printf("%d ", t[i]);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int x[100010], y[100010];
int n, m;
vector < int > row[100010], col[100010];
vector < int > d1[200010], d2[200010];
const int c = 100000;

bool cmpx(const int &lhs, const int &rhs){
    return x[lhs] < x[rhs];
}

bool cmpy(const int &lhs, const int &rhs){
    return y[lhs] < y[rhs];
}

int main()
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < m; i++){
        scanf("%d%d", x + i, y + i);
        row[x[i]].push_back(i);
        col[y[i]].push_back(i);
        d1[x[i]+y[i]].push_back(i);
        d2[x[i]-y[i]+c].push_back(i);
    }
    for(int i = 1; i <= n; i++){
        sort(row[i].begin(), row[i].end(), cmpy);
        sort(col[i].begin(), col[i].end(), cmpx);
    }
    for(int i = 0; i <= 200000; i++){
        sort(d1[i].begin(), d1[i].end(), cmpx);
        sort(d2[i].begin(), d2[i].end(), cmpx);
    }
    int t[9] = {};
    for(int i = 0; i < m; i++){
        int cur = 8;
        if(row[x[i]].front() == i) --cur;
        if(row[x[i]].back() == i) --cur;
        if(col[y[i]].front() == i) --cur;
        if(col[y[i]].back() == i) --cur;
        if(d1[x[i]+y[i]].front() == i) --cur;
        if(d1[x[i]+y[i]].back() == i) --cur;
        if(d2[x[i]-y[i]+c].front() == i) --cur;
        if(d2[x[i]-y[i]+c].back() == i) --cur;
        t[cur]++;
    }
    for(int i = 0; i <= 8; i++) printf("%d ", t[i]);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int x[100010], y[100010];
int n, m;
vector < int > row[100010], col[100010];
vector < int > d1[200010], d2[200010];
const int c = 100000;

bool cmpx(const int &lhs, const int &rhs){
    return x[lhs] < x[rhs];
}

bool cmpy(const int &lhs, const int &rhs){
    return y[lhs] < y[rhs];
}

int main()
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < m; i++){
        scanf("%d%d", x + i, y + i);
        row[x[i]].push_back(i);
        col[y[i]].push_back(i);
        d1[x[i]+y[i]].push_back(i);
        d2[x[i]-y[i]+c].push_back(i);
    }
    for(int i = 1; i <= n; i++){
        sort(row[i].begin(), row[i].end(), cmpy);
        sort(col[i].begin(), col[i].end(), cmpx);
    }
    for(int i = 0; i <= 2 * n; i++){
        sort(d1[i].begin(), d1[i].end(), cmpx);
        sort(d2[i].begin(), d2[i].end(), cmpx);
    }
    int t[9] = {};
    for(int i = 0; i < m; i++){
        int cur = 8;
        if(row[x[i]].front() == i) --cur;
        if(row[x[i]].back() == i) --cur;
        if(col[y[i]].front() == i) --cur;
        if(col[y[i]].back() == i) --cur;
        if(d1[x[i]+y[i]].front() == i) --cur;
        if(d1[x[i]+y[i]].back() == i) --cur;
        if(d2[x[i]-y[i]+c].front() == i) --cur;
        if(d2[x[i]-y[i]+c].back() == i) --cur;
        t[cur]++;
    }
    for(int i = 0; i <= 8; i++) printf("%d ", t[i]);
    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d\n",x)
#define pf2(x,y) printf("%d %d\n",x,y)
#define pf3(x,y,z) printf("%d %d %d\n",x,y,z)

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=n-1;i>=0;i--)
#define rep3(i,n) for(int i=n;i>1;i--)

#define fi first
#define se second
#define pb(x) push_back(x)
#define po(x) pop_back(x)
#define mp(x,y) make_pair(x,y)
#define sz(x) ((int) (x).size())
#define forech(a) a.begin(),a.end()
#define MAX 100007
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;

vi rw[100001], cl[100001], lr[200001], rl[200001];

int t[9];
int main()
{
    int n, m;
    sd2(n, m);
    pii cor[m];
    rep(i, m){
        int r,c;
        sd2(r, c);
        cor[i] = {r,c};
        rw[r].pb(c);
        cl[c].pb(r);
        lr[n+r-c].pb(c);
        rl[r+c].pb(c);
    }
    rep(i, n+1) sort(forech(rw[i])),sort(forech(cl[i]));
    rep(i, 2*n+1) sort(forech(lr[i])),sort(forech(rl[i]));

    rep(i, m){
        int cnt=0;
        int r=cor[i].fi;
        int c=cor[i].se;

        int ndx = lower_bound(rw[r].begin(), rw[r].end(), c)-rw[r].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rw[r])-1) cnt++;

        ndx = lower_bound(cl[c].begin(), cl[c].end(), r)-cl[c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(cl[c])-1) cnt++;

        ndx = lower_bound(rl[r+c].begin(), rl[r+c].end(), c)-rl[r+c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rl[r+c])-1) cnt++;

        ndx = lower_bound(lr[n+r-c].begin(), lr[n+r-c].end(), c)-lr[n+r-c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(lr[n+r-c])-1) cnt++;
        t[cnt]++;
    }
    rep(i, 9)   printf("%d ",t[i]);
    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d\n",x)
#define pf2(x,y) printf("%d %d\n",x,y)
#define pf3(x,y,z) printf("%d %d %d\n",x,y,z)

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=n-1;i>=0;i--)
#define rep3(i,n) for(int i=n;i>1;i--)

#define fi first
#define se second
#define pb(x) push_back(x)
#define po(x) pop_back(x)
#define mp(x,y) make_pair(x,y)
#define sz(x) ((int) (x).size())
#define MAX 100007
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;

vi rw[100001], cl[100001], lr[200001], rl[200001];
int t[9];
int main()
{
    int n, m;
    sd2(n, m);
    pii cor[m];
    rep(i, m){
        int r,c;
        sd2(r, c);
        cor[i] = {r,c};
        rw[r].pb(c);
        cl[c].pb(r);
        lr[n-c+r].pb(c);
        rl[r+c].pb(c);
    }
    rep(i, m){
        int cnt=0;
        int r=cor[i].fi;
        int c=cor[i].se;
        int ndx = lower_bound(rw[r].begin(), rw[r].end(), c)-rw[r].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rw[r])-1) cnt++;
        ndx = lower_bound(cl[c].begin(), cl[c].end(), r)-cl[c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(cl[c])-1) cnt++;
        ndx = lower_bound(rl[r+c].begin(), rl[r+c].end(), c)-rl[r+c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rl[r+c])-1) cnt++;
        ndx = lower_bound(lr[n+r-c].begin(), lr[n-c+r].end(), c)-lr[n-c+r].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(lr[n+r-c])-1) cnt++;
        // printf("%d ",cnt);
        t[cnt]++;
    }
    rep(i, 9)   printf("%d ",t[i]);
    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d\n",x)
#define pf2(x,y) printf("%d %d\n",x,y)
#define pf3(x,y,z) printf("%d %d %d\n",x,y,z)

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=n-1;i>=0;i--)
#define rep3(i,n) for(int i=n;i>1;i--)

#define fi first
#define se second
#define pb(x) push_back(x)
#define po(x) pop_back(x)
#define mp(x,y) make_pair(x,y)
#define sz(x) ((int) (x).size())
#define forech(a) a.begin(),a.end()
#define MAX 100007
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;

vi rw[100001], cl[100001], lr[200001], rl[200001];
unordered_set<int> srw, scl, slr, srl;
int t[9];
int main()
{
    int n, m;
    sd2(n, m);
    pii cor[m];
    rep(i, m){
        int r,c;
        sd2(r, c);
        cor[i] = {r,c};
        rw[r].pb(c);
        srw.insert(r);
        cl[c].pb(r);
        scl.insert(c);
        lr[n+r-c].pb(c);
        slr.insert(n+r-c);
        rl[r+c].pb(c);
        srl.insert(r+c);
    }
    for(auto a:srw)
        sort(forech(rw[a]));
    for(auto a:scl)
        sort(forech(cl[a]));
    for(auto a:slr)
        sort(forech(lr[a]));
    for(auto a:srl)
        sort(forech(rl[a]));

    rep(i, m){
        int cnt=0;
        int r=cor[i].fi;
        int c=cor[i].se;
        // sort(rw[r].begin(), rw[r].end());
        // sort(cl[c].begin(), cl[c].end());
        // sort(rl[r+c].begin(), rl[r+c].end());
        // sort(lr[n+r-c].begin(), lr[n+r-c].end());

        int ndx = lower_bound(rw[r].begin(), rw[r].end(), c)-rw[r].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rw[r])-1) cnt++;

        ndx = lower_bound(cl[c].begin(), cl[c].end(), r)-cl[c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(cl[c])-1) cnt++;

        ndx = lower_bound(rl[r+c].begin(), rl[r+c].end(), c)-rl[r+c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rl[r+c])-1) cnt++;

        ndx = lower_bound(lr[n+r-c].begin(), lr[n+r-c].end(), c)-lr[n+r-c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(lr[n+r-c])-1) cnt++;
        // printf("%d ",cnt);
        t[cnt]++;
    }
    rep(i, 9)   printf("%d ",t[i]);
    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d\n",x)
#define pf2(x,y) printf("%d %d\n",x,y)
#define pf3(x,y,z) printf("%d %d %d\n",x,y,z)

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=n-1;i>=0;i--)
#define rep3(i,n) for(int i=n;i>1;i--)

#define fi first
#define se second
#define pb(x) push_back(x)
#define po(x) pop_back(x)
#define mp(x,y) make_pair(x,y)
#define sz(x) ((int) (x).size())
#define MAX 100007
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;

vi rw[100001], cl[100001], lr[200001], rl[200001];
int t[9];
int main()
{
    int n, m;
    sd2(n, m);
    pii cor[m];
    rep(i, m){
        int r,c;
        sd2(r, c);
        cor[i] = {r,c};
        rw[r].pb(c);
        cl[c].pb(r);
        lr[n+r-c].pb(c);
        rl[r+c].pb(c);
    }

    rep(i, m){
        int cnt=0;
        int r=cor[i].fi;
        int c=cor[i].se;
        sort(rw[r].begin(), rw[r].end());
        sort(cl[c].begin(), cl[c].end());
        sort(rl[r+c].begin(), rl[r+c].end());
        sort(lr[n+r-c].begin(), lr[n+r-c].end());

        int ndx = lower_bound(rw[r].begin(), rw[r].end(), c)-rw[r].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rw[r])-1) cnt++;

        ndx = lower_bound(cl[c].begin(), cl[c].end(), r)-cl[c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(cl[c])-1) cnt++;

        ndx = lower_bound(rl[r+c].begin(), rl[r+c].end(), c)-rl[r+c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rl[r+c])-1) cnt++;

        ndx = lower_bound(lr[n+r-c].begin(), lr[n+r-c].end(), c)-lr[n+r-c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(lr[n+r-c])-1) cnt++;
        // printf("%d ",cnt);
        t[cnt]++;
    }
    rep(i, 9)   printf("%d ",t[i]);
    return 0;
}


#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define __ freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y)
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define pf(x) printf("%d\n",x)
#define pf2(x,y) printf("%d %d\n",x,y)
#define pf3(x,y,z) printf("%d %d %d\n",x,y,z)

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=n-1;i>=0;i--)
#define rep3(i,n) for(int i=n;i>1;i--)

#define fi first
#define se second
#define pb(x) push_back(x)
#define po(x) pop_back(x)
#define mp(x,y) make_pair(x,y)
#define sz(x) ((int) (x).size())
#define forech(a) a.begin(),a.end()
#define MAX 100007
using namespace std;

typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;

vi rw[100001], cl[100001], lr[200001], rl[200001];

int t[9];
int main()
{
    int n, m;
    sd2(n, m);
    pii cor[m];
    rep(i, m){
        int r,c;
        sd2(r, c);
        cor[i] = {r,c};
        rw[r].pb(c);
        cl[c].pb(r);
        lr[n+r-c].pb(c);
        rl[r+c].pb(c);
    }
    rep(i, n+1) sort(forech(rw[i])),sort(forech(cl[i]));
    rep(i, 2*n+1) sort(forech(lr[i])),sort(forech(lr[i]));

    rep(i, m){
        int cnt=0;
        int r=cor[i].fi;
        int c=cor[i].se;

        int ndx = lower_bound(rw[r].begin(), rw[r].end(), c)-rw[r].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rw[r])-1) cnt++;

        ndx = lower_bound(cl[c].begin(), cl[c].end(), r)-cl[c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(cl[c])-1) cnt++;

        ndx = lower_bound(rl[r+c].begin(), rl[r+c].end(), c)-rl[r+c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(rl[r+c])-1) cnt++;

        ndx = lower_bound(lr[n+r-c].begin(), lr[n+r-c].end(), c)-lr[n+r-c].begin();
        if(ndx!=0) cnt++;
        if(ndx<sz(lr[n+r-c])-1) cnt++;
        t[cnt]++;
    }
    rep(i, 9)   printf("%d ",t[i]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

// Author - Kevin Mathew
// Birla Institute of Technology, Mesra

unordered_map<ll, vector<pair<ll, ll> > > strDiag;
unordered_map<ll, vector<pair<ll, ll> > > altDiag;
unordered_map<ll, vector<pair<ll, ll> > > sameRow;
unordered_map<ll, vector<pair<ll, ll> > > sameCol;
vector<pair<ll, ll> > v;
ll n, m, ans[9];

void te(){
	for(ll i=0;i<9;i++)
		ans[i] = 0;
	cin >> n >> m;
	for(ll i=0;i<m;i++){
		ll r, c;
		cin >> r >> c;
		v.push_back(make_pair(r, c));
	}

	sort(v.begin(), v.end());

	for(ll i=0;i<m;i++){
		ll r, c;
		r = v[i].first, c = v[i].second;

		strDiag[r+c].push_back(make_pair(r, c));
		altDiag[r-c].push_back(make_pair(r, c));
		sameRow[r].push_back(make_pair(c, r));
		sameCol[c].push_back(make_pair(r, c));
	}

	for(ll i=0;i<=2*n;i++)
		if(strDiag[i].size() != 0)
			sort(strDiag[i].begin(), strDiag[i].end());

	for(ll i=-n;i<=n;i++)
		if(strDiag[i].size() != 0)
			sort(altDiag[i].begin(), altDiag[i].end());

	for(ll i=0;i<=n;i++)
		if(sameRow[i].size() != 0)
			sort(sameRow[i].begin(), sameRow[i].end());

	for(ll i=0;i<=n;i++)
		if(sameCol[i].size() != 0)
			sort(sameCol[i].begin(), sameCol[i].end());

	for(ll i=0;i<m;i++){
		ll s = 0;
		ll r = v[i].first, c = v[i].second;
		pair<ll, ll> p = v[i];
		pair<ll, ll> rev = make_pair((ll)c, (ll)r);
		if(strDiag[r+c].size() == 1)
			s += 0;
		else if(strDiag[r+c].size() == 2)
			s += 1;
		else{
			if(strDiag[r+c][0] == p || strDiag[r+c][strDiag[r+c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		if(altDiag[r-c].size() == 1)
			s += 0;
		else if(altDiag[r-c].size() == 2)
			s += 1;
		else{
			if(altDiag[r-c][0] == p || altDiag[r-c][altDiag[r-c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		if(sameRow[r].size() == 1)
			s += 0;
		else if(sameRow[r].size() == 2)
			s += 1;
		else{
			if(sameRow[r][0] == rev || sameRow[r][sameRow[r].size()-1] == rev)
				s++;
			else
				s+=2;
		}

		// for(ll i=0;i<sameRow[r].size();i++)
		// 	cout << sameRow[r][i].first << " " << sameRow[r][i].second << "\n";

		if(sameCol[c].size() == 1)
			s += 0;
		else if(sameCol[c].size() == 2)
			s += 1;
		else{
			if(sameCol[c][0] == p || sameCol[c][sameCol[c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		cout << r << " " << c << " " << s << "\n";

		ans[s]++;
	}

	for(ll i=0;i<9;i++)
		cout << ans[i] << " ";
	cout << "\n";
}

int main()
{
		// freopen("input.txt", "r", stdin);		//Comment
		// freopen("output.txt", "w", stdout);		//this out.
	ios::sync_with_stdio(false);			//Not
	cin.tie(NULL);							//this.
	cout.tie(0);							//or this.

	te();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

// Author - Kevin Mathew
// Birla Institute of Technology, Mesra

unordered_map<ll, vector<pair<ll, ll> > > strDiag;
unordered_map<ll, vector<pair<ll, ll> > > altDiag;
unordered_map<ll, vector<pair<ll, ll> > > sameRow;
unordered_map<ll, vector<pair<ll, ll> > > sameCol;
vector<pair<ll, ll> > v;
ll n, m, ans[9];

void te(){
	for(ll i=0;i<9;i++)
		ans[i] = 0;
	cin >> n >> m;
	for(ll i=0;i<m;i++){
		ll r, c;
		cin >> r >> c;

		strDiag[r+c].push_back(make_pair(r, c));
		altDiag[r-c].push_back(make_pair(r, c));
		sameRow[r].push_back(make_pair(c, r));
		sameCol[c].push_back(make_pair(r, c));
		v.push_back(make_pair(r, c));
	}

	for(ll i=0;i<=2*100000;i++)
		if(strDiag[i].size() != 0)
			sort(strDiag[i].begin(), strDiag[i].end());

	for(ll i=-100000;i<=100000;i++)
		if(strDiag[i].size() != 0)
			sort(altDiag[i].begin(), altDiag[i].end());

	for(ll i=0;i<=100000;i++)
		if(sameRow[i].size() != 0)
			sort(sameRow[i].begin(), sameRow[i].end());

	for(ll i=0;i<=100000;i++)
		if(sameCol[i].size() != 0)
			sort(sameCol[i].begin(), sameCol[i].end());

	for(ll i=0;i<m;i++){
		ll s = 0;
		ll r = v[i].first, c = v[i].second;
		pair<ll, ll> p = v[i];
		pair<ll, ll> rev = make_pair((ll)c, (ll)r);
		if(strDiag[r+c].size() == 1)
			s += 0;
		else if(strDiag[r+c].size() == 2)
			s += 1;
		else{
			if(strDiag[r+c][0] == p || strDiag[r+c][strDiag[r+c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		if(altDiag[r-c].size() == 1)
			s += 0;
		else if(altDiag[r-c].size() == 2)
			s += 1;
		else{
			if(altDiag[r-c][0] == p || altDiag[r-c][altDiag[r-c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		if(sameRow[r].size() == 1)
			s += 0;
		else if(sameRow[r].size() == 2)
			s += 1;
		else{
			if(sameRow[r][0] == rev || sameRow[r][sameRow[r].size()-1] == rev)
				s++;
			else
				s+=2;
		}

		// for(ll i=0;i<sameRow[r].size();i++)
		// 	cout << sameRow[r][i].first << " " << sameRow[r][i].second << "\n";

		if(sameCol[c].size() == 1)
			s += 0;
		else if(sameCol[c].size() == 2)
			s += 1;
		else{
			if(sameCol[c][0] == p || sameCol[c][sameCol[c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		// cout << r << " " << c << " " << s << "\n";

		ans[s]++;
	}

	for(ll i=0;i<9;i++)
		cout << ans[i] << " ";
	cout << "\n";
}

int main()
{
	// freopen("input.txt", "r", stdin);		//Comment
	// freopen("output.txt", "w", stdout);		//this out.
	ios::sync_with_stdio(false);			//Not
	cin.tie(NULL);							//this.
	cout.tie(0);							//or this.

	te();

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

// Author - Kevin Mathew
// Birla Institute of Technology, Mesra

unordered_map<ll, vector<pair<ll, ll> > > strDiag;
unordered_map<ll, vector<pair<ll, ll> > > altDiag;
unordered_map<ll, vector<pair<ll, ll> > > sameRow;
unordered_map<ll, vector<pair<ll, ll> > > sameCol;
vector<pair<ll, ll> > v;
ll n, m, ans[9];

void te(){
	for(ll i=0;i<9;i++)
		ans[i] = 0;
	cin >> n >> m;
	for(ll i=0;i<m;i++){
		ll r, c;
		cin >> r >> c;
		v.push_back(make_pair(r, c));
	}

	sort(v.begin(), v.end());

	for(ll i=0;i<m;i++){
		ll r, c;
		r = v[i].first, c = v[i].second;

		strDiag[r+c].push_back(make_pair(r, c));
		altDiag[r-c].push_back(make_pair(r, c));
		sameRow[r].push_back(make_pair(c, r));
		sameCol[c].push_back(make_pair(r, c));
	}

	for(ll i=0;i<=2*n;i++)
		if(strDiag[i].size() != 0)
			sort(strDiag[i].begin(), strDiag[i].end());

	for(ll i=-n;i<=n;i++)
		if(strDiag[i].size() != 0)
			sort(altDiag[i].begin(), altDiag[i].end());

	for(ll i=0;i<=n;i++)
		if(sameRow[i].size() != 0)
			sort(sameRow[i].begin(), sameRow[i].end());

	for(ll i=0;i<=n;i++)
		if(sameCol[i].size() != 0)
			sort(sameCol[i].begin(), sameCol[i].end());

	for(ll i=0;i<m;i++){
		ll s = 0;
		ll r = v[i].first, c = v[i].second;
		pair<ll, ll> p = v[i];
		pair<ll, ll> rev = make_pair((ll)c, (ll)r);
		if(strDiag[r+c].size() == 1)
			s += 0;
		else if(strDiag[r+c].size() == 2)
			s += 1;
		else{
			if(strDiag[r+c][0] == p || strDiag[r+c][strDiag[r+c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		if(altDiag[r-c].size() == 1)
			s += 0;
		else if(altDiag[r-c].size() == 2)
			s += 1;
		else{
			if(altDiag[r-c][0] == p || altDiag[r-c][altDiag[r-c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		if(sameRow[r].size() == 1)
			s += 0;
		else if(sameRow[r].size() == 2)
			s += 1;
		else{
			if(sameRow[r][0] == rev || sameRow[r][sameRow[r].size()-1] == rev)
				s++;
			else
				s+=2;
		}

		// for(ll i=0;i<sameRow[r].size();i++)
		// 	cout << sameRow[r][i].first << " " << sameRow[r][i].second << "\n";

		if(sameCol[c].size() == 1)
			s += 0;
		else if(sameCol[c].size() == 2)
			s += 1;
		else{
			if(sameCol[c][0] == p || sameCol[c][sameCol[c].size()-1] == p)
				s++;
			else
				s+=2;
		}

		// cout << r << " " << c << " " << s << "\n";

		ans[s]++;
	}

	for(ll i=0;i<9;i++)
		cout << ans[i] << " ";
	cout << "\n";
}

int main()
{
		// freopen("input.txt", "r", stdin);		//Comment
		// freopen("output.txt", "w", stdout);		//this out.
	ios::sync_with_stdio(false);			//Not
	cin.tie(NULL);							//this.
	cout.tie(0);							//or this.

	te();

	return 0;
}


/*
 * Work Over Your Laziness
 *
 */
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<queue>
#include<stack>
#include<cmath>
#include<set>
#include<sstream>
#include<iomanip>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI acos(-1.0)
#define FOR(i,j) for (int (i) = 0;(i) < (j);(i)++)
#define FORU(i,j,k) for (int (i) = (j);(i) <= (k);(i)++)
#define FORD(i,j,k) for (int (i) = (j);(i) >= (k);(i)--)

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ii,int> iii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ii> vii;

inline void base(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout<<fixed<<setprecision(6);
}

const int N = 1e5;

vector<int>hor[N + 5], ver[N + 5], dia1[2 * N + 5], dia2[2 * N + 5];
int ar[10];

int bs(vector<int> &ar, int tar){
	int l = 0, r = ar.size();
	int res = 2;
	while(l < r){
		int m = (l + r) / 2;
		if(ar[m] >= tar)r = m;
		else l = m + 1;
	}
	if(l == 0)res--;
	if(l == ar.size() - 1)res--;
	return res;
}

int main(){
	base();
	int n, m;
	cin >> n >> m;
	vector<ii> ls;
	for(int i = 0; i < m; ++i){
		int x, y;
		cin >> x >> y;
		ls.pb(ii(x, y));
	}

	sort(ls.begin(), ls.end());
	for(int i = 0; i < m; ++i){
		hor[ls[i].fi].pb(i);
		ver[ls[i].se].pb(i);

		dia1[ls[i].fi - (ls[i].se - 1)].pb(i);
		dia2[ls[i].fi - (n - ls[i].se)].pb(i);
	}

	for(int i = 0; i < m; ++i){
		int tmp = bs(hor[ls[i].fi], i) + bs(ver[ls[i].se], i);
		tmp += bs(dia1[ls[i].fi - (ls[i].se - 1)], i);
		tmp += bs(dia2[ls[i].fi - (n - ls[i].se)], i);
		ar[tmp]++;
	}

	for(int i = 0; i < 9; ++i){
		if(i)cout << " ";
		cout << ar[i];
	}cout << endl;

	return 0;
}


/*
 * Work Over Your Laziness
 *
 */
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<map>
#include<algorithm>
#include<string>
#include<string.h>
#include<queue>
#include<stack>
#include<cmath>
#include<set>
#include<sstream>
#include<iomanip>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI acos(-1.0)
#define FOR(i,j) for (int (i) = 0;(i) < (j);(i)++)
#define FORU(i,j,k) for (int (i) = (j);(i) <= (k);(i)++)
#define FORD(i,j,k) for (int (i) = (j);(i) >= (k);(i)--)

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<ii,int> iii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ii> vii;

inline void base(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cout<<fixed<<setprecision(6);
}

const int N = 1e5;

vector<int>hor[N + 5], ver[N + 5], dia1[2 * N + 5], dia2[2 * N + 5];
int ar[10];

int bs(vector<int> &ar, int tar){
	int l = 0, r = ar.size();
	int res = 2;
	while(l < r){
		int m = (l + r) / 2;
		if(ar[m] >= tar)r = m;
		else l = m + 1;
	}
	if(l == 0)res--;
	if(l == ar.size() - 1)res--;
	return res;
}

int main(){
	base();
	int n, m;
	cin >> n >> m;
	vector<ii> ls;
	for(int i = 0; i < m; ++i){
		int x, y;
		cin >> x >> y;
		ls.pb(ii(x, y));
	}

	sort(ls.begin(), ls.end());
	for(int i = 0; i < m; ++i){
		hor[ls[i].fi].pb(i);
		ver[ls[i].se].pb(i);

		dia1[ls[i].fi - (ls[i].se - 1) + n].pb(i);
		dia2[ls[i].fi - (n - ls[i].se) + n].pb(i);
	}

	for(int i = 0; i < m; ++i){
		int tmp = bs(hor[ls[i].fi], i) + bs(ver[ls[i].se], i);
		tmp += bs(dia1[ls[i].fi - (ls[i].se - 1) + n], i);
		tmp += bs(dia2[ls[i].fi - (n - ls[i].se) + n], i);
		ar[tmp]++;
	}

	for(int i = 0; i < 9; ++i){
		if(i)cout << " ";
		cout << ar[i];
	}cout << endl;

	return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli D1cl[10*MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });
    lli deel=0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        deel += cnt[qns[i].y];
    }
    for(int i=0; i < m; i++)
    {
        dudle += (D1cl[qns[i].x.x + qns[i].x.y]>0);

        D1cl[qns[i].x.x + qns[i].x.y]++;
    }
    if(sp)
        cout << dudle <<' '<<deel<< endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 2000012;
int offs = 1000001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli D1cl[10*MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });
    lli deel=0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        deel += cnt[qns[i].y];
    }
    for(int i=0; i < m; i++)
    {
        dudle += (D1cl[qns[i].x.x + qns[i].x.y]>0);

        D1cl[qns[i].x.x + qns[i].x.y]++;
    }
    if(sp)
        cout << dudle <<' '<<deel<< endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 2000012;
int offs = 1000001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }
    if(sp)
        cout << dudle << endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli D1cl[10*MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });
    lli deel=0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        deel += (D1c[qns[i].x.x + qns[i].x.y]>1);
    }
    for(int i=0; i < m; i++)
    {
        dudle += (D1cl[qns[i].x.x + qns[i].x.y]>0);

        D1cl[qns[i].x.x + qns[i].x.y]++;
    }
    if(sp)
        cout << dudle <<' '<<deel<< endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }
    if(sp)
        cout << maxx;
    assert(maxx < MM);
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM], D2c[MM];
lli Va[MM/2], Ha[MM/2], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    assert(maxx < MM);
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = MM/2;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM << 2], D2c[MM << 2];
lli Va[MM/2], Ha[MM/2], D1a[MM << 2], D2a[MM << 2];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);
    if(sp)
        cout << maxn;
    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    assert(maxx < MM);
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }
    if(sp)
        cout << dudle << endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = MM/2;
lli m,n,k,p1,p2,p3,p,f;
lli Vt[MM/2], Ht[MM/2], D1t[MM], D2t[MM];
lli Vc[MM/2], Hc[MM/2], D1c[MM], D2c[MM];
lli Va[MM/2], Ha[MM/2], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }
    // for(int i=0; i<m; i++)
    // cout << cnt[i] << endl;
    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = 150000;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM<< 1], D2c[MM];
lli Va[MM/2], Ha[MM/2], D1a[MM<< 1], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 2000012;
int offs = 1000001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
        dudle += cnt[qns[i].y];
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
        dudle += cnt[qns[i].y];
    }
    if(sp)
        cout << dudle << endl;
    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
        dudle += cnt[qns[i].y];
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
        dudle += cnt[qns[i].y];
    }
    if(sp)
        cout << dudle << endl;
    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = MM;
lli m,n,k,p1,p2,p3,p,f;
lli Vt[MM/2], Ht[MM/2], D1t[MM], D2t[MM];
lli Vc[MM/2], Hc[MM/2], D1c[MM], D2c[MM];
lli Va[MM/2], Ha[MM/2], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 2000012;
int offs = 1000001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }
        if(sp)
        cout << dudle << endl;

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = MM/2;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM << 2], D2c[MM << 2];
lli Va[MM/2], Ha[MM/2], D1a[MM << 2], D2a[MM << 2];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    if(maxx > 4e5)
        cout << " wtf ";

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 1e6;
int offs = 4e5;
lli m,n,k,p1,p2,p3,p,f;
lli Vt[MM/2], Ht[MM/2], D1t[MM], D2t[MM];
lli Vc[MM/2], Hc[MM/2], D1c[MM], D2c[MM];
lli Va[MM/2], Ha[MM/2], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }
    // for(int i=0; i<m; i++)
    // cout << cnt[i] << endl;
    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 2000012;
int offs = 1000001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli D1cl[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });
    lli deel=0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        deel += (D1c[qns[i].x.x + qns[i].x.y]>1);
    }
    for(int i=0; i < m; i++)
    {
        dudle += (D1cl[qns[i].x.x + qns[i].x.y]>0);

        D1cl[qns[i].x.x + qns[i].x.y]++;
    }
    if(sp)
        cout << dudle <<' '<<deel<< endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 200012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }
        if(sp)
        cout << dudle << endl;

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = 150000;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM], D2c[MM << 1];
lli Va[MM/2], Ha[MM/2], D1a[MM], D2a[MM << 1];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = 150000;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM << 1], D2c[MM << 1];
lli Va[MM/2], Ha[MM/2], D1a[MM << 1], D2a[MM << 1];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 2000012;
int offs = 100001;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM], Hc[MM], D1c[MM], D2c[MM];
lli D1cl[MM];
lli Va[MM], Ha[MM], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;
    lli maxn = 0;
    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
        maxn = max(qns[i].x.x + qns[i].x.y, maxn);
    }
    bool sp = (qns[0].x.x == 90321);

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });
    lli maxx = 0;
    lli dudle = 0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
        maxx = max(maxx, qns[i].x.x - qns[i].x.y + offs);
        maxx = max(maxx, qns[i].x.x + qns[i].x.y);
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
            }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });
    lli deel=0;
    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
        deel += (D1c[qns[i].x.x + qns[i].x.y]>1);
    }
    for(int i=0; i < m; i++)
    {
        dudle += (D1cl[qns[i].x.x + qns[i].x.y]>0);

        D1cl[qns[i].x.x + qns[i].x.y]++;
    }
    if(sp)
        cout << dudle <<' '<<deel<< endl;
    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
        dudle += cnt[qns[i].y];

    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = (MM << 1) - 1;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM << 2], D2c[MM << 2];
lli Va[MM/2], Ha[MM/2], D1a[MM << 2], D2a[MM << 2];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = MM;
lli m,n,k,p1,p2,p3,p,f;
lli Vc[MM/2], Hc[MM/2], D1c[MM << 2], D2c[MM << 2];
lli Va[MM/2], Ha[MM/2], D1a[MM << 2], D2a[MM << 2];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}


#include <bits/stdc++.h>
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define x first
#define y second
using namespace std;
typedef int lli;
typedef pair <pair<int, int>, int> PT;
const int MM = 320000;
int offs = 150000;
lli m,n,k,p1,p2,p3,p,f;
lli Vt[MM/2], Ht[MM/2], D1t[MM], D2t[MM];
lli Vc[MM/2], Hc[MM/2], D1c[MM], D2c[MM];
lli Va[MM/2], Ha[MM/2], D1a[MM], D2a[MM];
PT qns[MM];
int cnt[MM];
int main(){fio; // remove during scanf

    cin >> n >> m;

    for(int i=0; i<m; i++)
    {
        cin >> qns[i].x.x >> qns[i].x.y;
        qns[i].y = i;
    }

    lli ans[9] = {0};

    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(x1.x.y, x1.x.x) < make_pair(x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] = (Vc[qns[i].x.y]>0) + (Hc[qns[i].x.x]>0) + (D1c[qns[i].x.x - qns[i].x.y + offs]>0);
        Vc[qns[i].x.y]++;
        Hc[qns[i].x.x]++;
        D1c[qns[i].x.x - qns[i].x.y + offs]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (Va[qns[i].x.y]>0) + (Ha[qns[i].x.x]>0) + (D1a[qns[i].x.x - qns[i].x.y + offs]>0);
        Va[qns[i].x.y]++;
        Ha[qns[i].x.x]++;
        D1a[qns[i].x.x - qns[i].x.y + offs]++;
    }
    // for(int i=0; i<m; i++)
    // cout << cnt[i] << endl;
    sort(qns, qns + m, [=](PT x1, PT x2){
        return make_pair(-x1.x.y, x1.x.x) < make_pair(-x2.x.y, x2.x.x);
    });

    for(int i=0; i < m; i++)
    {
        cnt[qns[i].y] += (D1c[qns[i].x.x + qns[i].x.y]>0);
        D1c[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i= m-1; i >= 0; i--)
    {
        cnt[qns[i].y] += (D1a[qns[i].x.x + qns[i].x.y]>0);
        D1a[qns[i].x.x + qns[i].x.y]++;
    }

    for(int i=0; i<m; i++)
        ans[cnt[i]]++;

    for(int i=0; i<=8; i++)
        cout << ans[i] << ' ';

    return 0;
}