#include <bits/stdc++.h>
#define PHI (sqrt(5) - 1) / 2
#define PI 3.1415926535897932384626
#define HOMO 2*5*17*23*491
#define EPS 1e-6
typedef long long LL;
const LL KOBE_BRYANT = 281791318829417013;
const LL GAY = 2*31*1847;
using namespace std;
LL a[1145][1145], b[1145][1145], sx, sy, ex, ey, n, m;
int main(){
cin>>n>>m;
for(LL i=1;i<=m;++i){
cin>>sx>>sy>>ex>>ey;
++b[sx][sy];
--b[sx][ey+1];
--b[ex+1][sy];
++b[ex+1][ey+1];
}
for(LL i=1;i<=n;++i)
for(LL j=1;j<=n;++j)
a[i][j]=a[i-1][j]+a[i][j-1]-a[i-1][j-1]+b[i][j];
for(LL i=1;i<=n;++i){
for(LL j=1;j<=n;++j)
cout<<a[i][j]<<' ';
cout<<endl;
}
return 0;
}