#include<iostream>
#define int long long
using namespace std;
int a[1001][1001];
int d[1001][1001];
signed main()
{
int n, m;
cin >> n >> m;
while (m--)
{
int x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
d[x1][y1]++;
d[x1][y2 + 1]--;
d[x2 + 1][y1]--;
d[x2 + 1][y2 + 1]++;
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
d[i][j] += d[i][j - 1] + d[i - 1][j] - d[i - 1][j - 1];
cout << d[i][j] << " ";
}cout << endl;
}
return 0;
}