#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define all(x) x.begin(), x.end()
using namespace std;
const int maxn = 2e5 + 1;
ll A[maxn], D[maxn];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// freopen("file.inp","r",stdin);
// freopen("file.out","w",stdout);
int n, q;
cin >> n >> q;
int l, r, x, num;
for (int i = 1; i <= q; ++i) {
cin >> num >> l >> r >> x;
if (num == 1) {
D[l - 1] += x;
D[r] -= x;
}
else {
D[l - 1] -= x;
D[r] += x;
}
}
for (int i = 1; i <= n; ++i) {
A[i] = A[i-1] + D[i-1];
}
for (int i = 1; i <= n; ++i) {
cout << A[i] << " ";
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSB1bGwgdW5zaWduZWQgbG9uZyBsb25nCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgYWxsKHgpIHguYmVnaW4oKSwgeC5lbmQoKQp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBpbnQgbWF4biA9IDJlNSArIDE7CmxsIEFbbWF4bl0sIERbbWF4bl07CmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsgY2luLnRpZSgwKTsgY291dC50aWUoMCk7CiAgICAvLyBmcmVvcGVuKCJmaWxlLmlucCIsInIiLHN0ZGluKTsKICAgIC8vIGZyZW9wZW4oImZpbGUub3V0IiwidyIsc3Rkb3V0KTsKICAgIGludCBuLCBxOwogICAgY2luID4+IG4gPj4gcTsKICAgIGludCBsLCByLCB4LCBudW07CiAgICBmb3IgKGludCBpID0gMTsgaSA8PSBxOyArK2kpIHsKICAgICAgICBjaW4gPj4gbnVtID4+IGwgPj4gciA+PiB4OwogICAgICAgIGlmIChudW0gPT0gMSkgewogICAgICAgICAgICBEW2wgLSAxXSArPSB4OwogICAgICAgICAgICBEW3JdIC09IHg7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBEW2wgLSAxXSAtPSB4OwogICAgICAgICAgICBEW3JdICs9IHg7CiAgICAgICAgfQogICAgfQogICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbjsgKytpKSB7CiAgICAgICAgQVtpXSA9IEFbaS0xXSArIERbaS0xXTsKICAgIH0KICAgIGZvciAoaW50IGkgPSAxOyBpIDw9IG47ICsraSkgewogICAgICAgIGNvdXQgPDwgQVtpXSA8PCAiICI7CiAgICB9Cn0=