//DER.......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<functional>
#include<math.h>
#include<assert.h>
#include<stdarg.h>
#include<time.h>
#include<limits.h>
#include<ctype.h>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<vector>
#include<iostream>
#include<sstream>
using namespace std;

// #defines
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define LPI(i,n) for(int i=0;i<(n);i++)
#define LPI1(i,a,b) for(int i=(a);i<=(b);i++)
#define LPIL(i,x) for(int i=0;x[i];i++)
#define LPD(i,n) for(int i=(n)-1;i>=0;i--)
#define LPD1(i,a,b) for(int i=(a);i>=(b);i--)
#define I(x) scanf("%d",&x)
#define RI(x) int x;I(x)
#define II(x,y) scanf("%d%d",&x,&y)
#define RII(x,y) int x,y;II(x,y)
#define III(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define RIII(x,y,z) int x,y,z;III(x,y,z)
#define RS(x) scanf("%s",x)
#define PI(x) printf("%d\n",x)
#define PIS(x) printf("%d ",x)
#define CASET int ___T,cas=1;scanf("%d ",&___T);while(___T--)
#define CASEN0(n) int cas=1;while(scanf("%d",&n)!=EOF&&n)
#define CASEN(n) int cas=1;while(scanf("%d",&n)!=EOF)
#define MP make_pair
#define PB push_back
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,-1,sizeof(x))
#define SEP(x) ((x)?'\n':' ')
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define F first
#define S second
#ifdef ONLINE_JUDGE
#define FILEIO(x) freopen(#x ".in","r",stdin);freopen(#x ".out","w",stdout);
#define FILEIOS freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#else
#define FILEIO(x) ;
#define FILEIOS ;
#endif
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
LL A[100005];
int B[100005][4];
LL s[100005];
LL s1[10005];
int main(){
    LL a,b,c;
    RIII(n,m,k);
    LPI(i,n)
    {
        RI(x);
        A[i+1]=x;
    }
    MS0(s);
    LPI(i,m)
    {
        RIII(l,r,d);
        B[i+1][0]=l;B[i+1][1]=r;B[i+1][2]=d;
    }
    MS0(s1);
    LPI(i,k)
    {
        RII(x,y);
        s1[x]+=1;
        s1[y+1]-=1;
    }
    LPI(i,m)
    {
        a=B[i+1][0];b=B[i+1][1];c=B[i+1][2];
        s[a]=s[a]+s1[i+1]*c;
        s[b+1]=s[b+1]-s1[i+1]*c;
        s1[i+2]=s1[i+2]+s1[i+1];
    }
    LPI(i,n)
    {

        cout<<(A[i+1]+s[i+1])<<" ";
        s[i+2]=s[i+2]+s[i+1];

    }

    return 0;
}


//DER.......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<functional>
#include<math.h>
#include<assert.h>
#include<stdarg.h>
#include<time.h>
#include<limits.h>
#include<ctype.h>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<vector>
#include<iostream>
#include<sstream>
using namespace std;

// #defines
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define LPI(i,n) for(int i=0;i<(n);i++)
#define LPI1(i,a,b) for(int i=(a);i<=(b);i++)
#define LPIL(i,x) for(int i=0;x[i];i++)
#define LPD(i,n) for(int i=(n)-1;i>=0;i--)
#define LPD1(i,a,b) for(int i=(a);i>=(b);i--)
#define I(x) scanf("%d",&x)
#define RI(x) int x;I(x)
#define II(x,y) scanf("%d%d",&x,&y)
#define RII(x,y) int x,y;II(x,y)
#define III(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define RIII(x,y,z) int x,y,z;III(x,y,z)
#define RS(x) scanf("%s",x)
#define PI(x) printf("%d\n",x)
#define PIS(x) printf("%d ",x)
#define CASET int ___T,cas=1;scanf("%d ",&___T);while(___T--)
#define CASEN0(n) int cas=1;while(scanf("%d",&n)!=EOF&&n)
#define CASEN(n) int cas=1;while(scanf("%d",&n)!=EOF)
#define MP make_pair
#define PB push_back
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,-1,sizeof(x))
#define SEP(x) ((x)?'\n':' ')
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define F first
#define S second
#ifdef ONLINE_JUDGE
#define FILEIO(x) freopen(#x ".in","r",stdin);freopen(#x ".out","w",stdout);
#define FILEIOS freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#else
#define FILEIO(x) ;
#define FILEIOS ;
#endif
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
struct node
{
    long l;
    long r;
    long d;
};
LL A[100005];
node B[100005];
LL s[100005];
LL s1[100005];

int main(){

    RIII(n,m,k);
    LPI(i,n)
    {
        RI(x);
        A[i+1]=x;
    }
    MS0(s);
    LPI(i,m)
    {
        RIII(l,r,d);
        B[i+1]={l,r,d};
    }
    MS0(s1);
    long int x,y;
    LPI(i,k)
    {
        scanf("%ld%ld",&x,&y);
        s1[x]=s1[x]+1;
        s1[y+1]=s1[y+1]-1;
    }
    LPI(i,m)
    {
        s[B[i+1].l]+=s1[i+1]*B[i+1].d;
        s[B[i+1].r+1]-=s1[i+1]*B[i+1].d;
        s1[i+2]+=s1[i+1];
    }
    LPI(i,n)
    {

        cout<<(A[i+1]+s[i+1])<<" ";
        s[i+2]=s[i+2]+s[i+1];

    }

    return 0;
}


//DER.......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<functional>
#include<math.h>
#include<assert.h>
#include<stdarg.h>
#include<time.h>
#include<limits.h>
#include<ctype.h>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<vector>
#include<iostream>
#include<sstream>
using namespace std;

// #defines
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define LPI(i,n) for(int i=0;i<(n);i++)
#define LPI1(i,a,b) for(int i=(a);i<=(b);i++)
#define LPIL(i,x) for(int i=0;x[i];i++)
#define LPD(i,n) for(int i=(n)-1;i>=0;i--)
#define LPD1(i,a,b) for(int i=(a);i>=(b);i--)
#define I(x) scanf("%d",&x)
#define RI(x) int x;I(x)
#define II(x,y) scanf("%d%d",&x,&y)
#define RII(x,y) int x,y;II(x,y)
#define III(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define RIII(x,y,z) int x,y,z;III(x,y,z)
#define RS(x) scanf("%s",x)
#define PI(x) printf("%d\n",x)
#define PIS(x) printf("%d ",x)
#define CASET int ___T,cas=1;scanf("%d ",&___T);while(___T--)
#define CASEN0(n) int cas=1;while(scanf("%d",&n)!=EOF&&n)
#define CASEN(n) int cas=1;while(scanf("%d",&n)!=EOF)
#define MP make_pair
#define PB push_back
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,-1,sizeof(x))
#define SEP(x) ((x)?'\n':' ')
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define F first
#define S second
#ifdef ONLINE_JUDGE
#define FILEIO(x) freopen(#x ".in","r",stdin);freopen(#x ".out","w",stdout);
#define FILEIOS freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#else
#define FILEIO(x) ;
#define FILEIOS ;
#endif
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
struct node
{
    long l;
    long r;
    long d;
};
LL A[100005];
node B[100005];
LL s[100005];
LL s1[10005];

int main(){

    RIII(n,m,k);
    LPI(i,n)
    {
        RI(x);
        A[i+1]=x;
    }
    MS0(s);
    LPI(i,m)
    {
        RIII(l,r,d);
        B[i+1]={l,r,d};
    }
    MS0(s1);
    LPI(i,k)
    {
        RII(x,y);
        s1[x]+=1;
        s1[y+1]-=1;
    }
    LPI(i,m)
    {
        if(s1[i+1]>100000)
        cout<<"s";
        s[B[i+1].l]+=s1[i+1]*B[i+1].d;
        s[B[i+1].r+1]-=s1[i+1]*B[i+1].d;
        s1[i+2]+=s1[i+1];
    }
    LPI(i,n)
    {

        cout<<(A[i+1]+s[i+1])<<" ";
        s[i+2]=s[i+2]+s[i+1];

    }

    return 0;
}


//DER.......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<functional>
#include<math.h>
#include<assert.h>
#include<stdarg.h>
#include<time.h>
#include<limits.h>
#include<ctype.h>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<algorithm>
#include<vector>
#include<iostream>
#include<sstream>
using namespace std;

// #defines
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#define LPI(i,n) for(int i=0;i<(n);i++)
#define LPI1(i,a,b) for(int i=(a);i<=(b);i++)
#define LPIL(i,x) for(int i=0;x[i];i++)
#define LPD(i,n) for(int i=(n)-1;i>=0;i--)
#define LPD1(i,a,b) for(int i=(a);i>=(b);i--)
#define I(x) scanf("%d",&x)
#define RI(x) int x;I(x)
#define II(x,y) scanf("%d%d",&x,&y)
#define RII(x,y) int x,y;II(x,y)
#define III(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define RIII(x,y,z) int x,y,z;III(x,y,z)
#define RS(x) scanf("%s",x)
#define PI(x) printf("%d\n",x)
#define PIS(x) printf("%d ",x)
#define CASET int ___T,cas=1;scanf("%d ",&___T);while(___T--)
#define CASEN0(n) int cas=1;while(scanf("%d",&n)!=EOF&&n)
#define CASEN(n) int cas=1;while(scanf("%d",&n)!=EOF)
#define MP make_pair
#define PB push_back
#define MS0(x) memset(x,0,sizeof(x))
#define MS1(x) memset(x,-1,sizeof(x))
#define SEP(x) ((x)?'\n':' ')
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define F first
#define S second
#ifdef ONLINE_JUDGE
#define FILEIO(x) freopen(#x ".in","r",stdin);freopen(#x ".out","w",stdout);
#define FILEIOS freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#else
#define FILEIO(x) ;
#define FILEIOS ;
#endif
typedef pair<int,int> PII;
typedef long long LL;
typedef unsigned long long ULL;
struct node
{
    long l;
    long r;
    long d;
};
LL A[100005];
node B[100005];
LL s[100005];
long s1[100005];

int main(){

    RIII(n,m,k);
    LPI(i,n)
    {
        RI(x);
        A[i+1]=x;
    }
    MS0(s);
    LPI(i,m)
    {
        RIII(l,r,d);
        B[i+1]={l,r,d};
    }
    MS0(s1);
    int x,y;
    LPI(i,k)
    {
        scanf("%d%d",&x,&y);
        s1[x]=s1[x]+1;
        s1[y+1]=s1[y+1]-1;
    }
    LPI(i,m)
    {
        s[B[i+1].l]+=s1[i+1]*B[i+1].d;
        s[B[i+1].r+1]-=s1[i+1]*B[i+1].d;
        s1[i+2]+=s1[i+1];
    }
    LPI(i,n)
    {

        cout<<(A[i+1]+s[i+1])<<" ";
        s[i+2]=s[i+2]+s[i+1];

    }

    return 0;
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[100005],r[100005],d[100005];
ll t1[400005],pr1[400005];
ll pr2[400005],a[100005],t2[400005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	p = 1;
    while (p < n)
        p = p << 1;

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  sum1(1,1,p,i - p + 1, i - p + 1);
	//govno
	for(i = p; i < p + n; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  update2(1,1,p,i - p + 1, i - p + 1,0);

	for(i = p; i < p + n; i++)
	  cout << t2[i] << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[100005],r[100005],d[100005];
ll t1[400005],pr1[400005];
ll pr2[400005],a[100005],t2[400005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	int ff1 = 1;
	int ff2 = 1;

    while (ff1 < n)
        ff1 = ff1 << 1;
    while (ff2 < m)
        ff2 = ff2 << 1;
    p = max(ff1,ff2);

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  sum1(1,1,p,i - p + 1, i - p + 1);
	//govno
	for(i = p; i < p + n; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  update2(1,1,p,i - p + 1, i - p + 1,0);

	for(i = p; i < p + n; i++)
	  cout << t2[i] << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[500005],r[500005],d[500005];
ll t1[500005],pr1[500005];
ll pr2[500005],a[500005],t2[500005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	ll ff1 = 1;
	ll ff2 = 1;

    while (ff1 < n)
        ff1 = ff1 << 1;
    while (ff2 < m)
        ff2 = ff2 << 1;
    p = max(ff1,ff2);

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  sum1(1,1,p,i - p + 1, i - p + 1);

	for(i = p; i < p + n; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  sum2(1,1,p,i-p+1,i-p+1);

	for(i = p; i < p + n; i++)
		cout << t2[i] << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[500005],r[500005],d[500005];
ll t1[500005],pr1[500005];
ll pr2[500005],a[500005],t2[500005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	ll ff1 = 1;
	ll ff2 = 1;

    while (ff1 < n)
        ff1 = ff1 << 1;
    while (ff2 < m)
        ff2 = ff2 << 1;
    p = max(ff1,ff2);

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  sum1(1,1,p,i - p + 1, i - p + 1);

	for(i = p; i < p + m; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  sum2(1,1,p,i-p+1,i-p+1);

	for(i = p; i < p + n; i++)
		cout << t2[i] << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[100005],r[100005],d[100005];
ll t1[400005],t2[400005],pr1[400005],pr2[400005],a[100005];

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	p = 1;
    while (p < n)
        p = p << 1;

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < m; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  update1(1,1,p,i - p + 1, i - p + 1,0);
	//govno
	for(i = p; i < p + n; i++){
	  if (t1[i] != 0)
	  	update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  update2(1,1,p,i - p + 1, i - p + 1,0);

	for(i = p; i < p + n; i++)
	  cout << t2[i] << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[500005],r[500005],d[500005];
ll t1[500005],pr1[500005];
ll pr2[500005],a[500005],t2[500005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	ll ff1 = 1;
	ll ff2 = 1;

    while (ff1 < n)
        ff1 = ff1 << 1;
    while (ff2 < m)
        ff2 = ff2 << 1;
    p = max(ff1,ff2);

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  t1[i] = sum1(1,1,p,i - p + 1, i - p + 1);

	for(i = p; i < p + m; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  cout << sum2(1,1,p,i-p+1,i-p+1) << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[500005],r[500005],d[500005];
ll t1[500005],pr1[500005];
ll pr2[500005],a[500005],t2[500005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	ll ff1 = 1;
	ll ff2 = 1;

    while (ff1 < n)
        ff1 = ff1 << 1;
    while (ff2 < m)
        ff2 = ff2 << 1;
    p = max(ff1,ff2);

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + m; i++)
	  t1[i] = sum1(1,1,p,i - p + 1, i - p + 1);

	for(i = p; i < p + m; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  cout << sum2(1,1,p,i-p+1,i-p+1) << " ";
}


#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
using namespace std;
#pragma comment(linker, "/STACK:16777216") //16mb
#define sc second
#define fs first
#define forr(i,n) for(i = 0; i < n; i++)
typedef long long ll;

ll l[500005],r[500005],d[500005];
ll t1[500005],pr1[500005];
ll pr2[500005],a[500005],t2[500005];;

void push1(ll v, ll l, ll r){
    if (pr1[v] != 0){
        t1[v*2] += pr1[v]*((l+r)/2-l+1);
        pr1[v*2] += pr1[v];
        t1[v*2+1] += pr1[v]*(r - (l+r)/2);
        pr1[v*2+1] += pr1[v];
        pr1[v] = 0;
    }
}

void update1(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push1(v,l,r);
    if (l >= x && r <= y){
        t1[v] += f * (r - l + 1);
        pr1[v] = f;
        return;
    }
    update1(v*2,l,(l+r)/2,x,y,f);
    update1(v*2+1,(l+r)/2+1,r,x,y,f);
    t1[v] = t1[v*2] + t1[v*2+1];
}

ll sum1(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push1(v,l,r);
    if (l >= x && r <= y)
        return t1[v];
    return sum1(v*2,l,(l+r)/2,x,y) + sum1(v*2+1,(l+r)/2+1,r,x,y);
}

void push2(ll v, ll l, ll r){
    if (pr2[v] != 0){
        t2[v*2] += pr2[v]*((l+r)/2-l+1);
        pr2[v*2] += pr2[v];
        t2[v*2+1] += pr2[v]*(r - (l+r)/2);
        pr2[v*2+1] += pr2[v];
        pr2[v] = 0;
    }
}

void update2(ll v, ll l, ll r, ll x, ll y, ll f){
    if (y < l || x > r) return;
    push2(v,l,r);
    if (l >= x && r <= y){
        t2[v] += f * (r - l + 1);
        pr2[v] = f;
        return;
    }
    update2(v*2,l,(l+r)/2,x,y,f);
    update2(v*2+1,(l+r)/2+1,r,x,y,f);
    t2[v] = t2[v*2] + t2[v*2+1];
}

ll sum2(ll v, ll l, ll r, ll x, ll y){
    if (y < l || x > r) return 0;
    push2(v,l,r);
    if (l >= x && r <= y)
        return t2[v];
    return sum2(v*2,l,(l+r)/2,x,y) + sum2(v*2+1,(l+r)/2+1,r,x,y);
}

int main() {
	ios_base::sync_with_stdio(0);

	#ifndef ONLINE_JUDGE
 	 	freopen("input.txt", "r", stdin);
	  	freopen("output.txt", "w", stdout);
	#endif
	ll n,i,j,m,k,p,x,y;
	cin >> n >> m >> k;

	ll ff1 = 1;
	ll ff2 = 1;

    while (ff1 < n)
        ff1 = ff1 << 1;
    while (ff2 < m)
        ff2 = ff2 << 1;
    p = max(ff1,ff2);

	for(i = 0; i < n; i++){
        cin >> x;
        t2[i+p] = x;
    }

    i = p - 1;
    while (i > 0){
        t2[i] = t2[i*2] + t2[i*2+1];
        i--;
    }

	for(i = 0; i < m; i++){
		cin >> l[i] >> r[i] >> d[i];
	}

	for(i = 0; i < k; i++){
	  cin >> x >> y;
	  update1(1,1,p,x,y,1);
	}
	for(i = p; i < p + n; i++)
	  sum1(1,1,p,i - p + 1, i - p + 1);
	//govno
	for(i = p; i < p + n; i++){
	  update2(1,1,p,l[i-p],r[i-p],d[i-p] * t1[i]);
	}

	for(i = p; i < p + n; i++)
	  update2(1,1,p,i - p + 1, i - p + 1,0);

	for(i = p; i < p + n; i++)
		cout << t2[i] << " ";
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())

int n, m, k;
LL a[100010];
int l[100010], r[100010], d[100010], x[100010], y[100010];

int xx[100010], yy[100010];

LL opecnt[100010], IMOS[100010];

void init() {
    REP(i, 100010){
        xx[i] = 0;
        yy[i] = 0;
        opecnt[i] = 0;
        IMOS[i] = 0;
    }
}

void input() {
    cin >> n >> m >> k;
    REP(i, n) cin >> a[i];
    REP(i, m) cin >> l[i] >> r[i] >> d[i];
    REP(i, m){
        l[i]--;
        r[i]--;
    }
    REP(i, k) cin >> x[i] >> y[i];
    REP(i, k){
        x[i]--;
        y[i]--;
    }
}

void solve() {

    REP(i, k){
        opecnt[x[i]]++;
        opecnt[y[i]+1]--;
    }
    FOR(i, 1, m) opecnt[i] += opecnt[i-1];
    REP(i, m){
        IMOS[l[i]] += opecnt[i] * d[i];
        IMOS[r[i]+1] -= opecnt[i] * d[i];
    }
    FOR(i, 1, n) IMOS[i] += IMOS[i-1];
    REP(i, n) cout << a[i] + IMOS[i]  << " ";

    cout << endl;
}

int main() {
	init();
    input();
    solve();
	return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())

int n, m, k;
LL a[100010];
int l[100010], r[100010], d[100010], x[100010], y[100010];

int xx[100010], yy[100010];

LL opecnt[100010], IMOS[100010];

void init() {
    REP(i, 100010){
        xx[i] = 0;
        yy[i] = 0;
        opecnt[i] = 0;
        IMOS[i] = 0;
    }
}

void input() {
    cin >> n >> m >> k;
    REP(i, n) cin >> a[i];
    REP(i, m) cin >> l[i] >> r[i] >> d[i];
    REP(i, m){
        l[i]--;
        r[i]--;
    }
    REP(i, k) cin >> x[i] >> y[i];
    REP(i, k){
        x[i]--;
        y[i]--;
    }
}

void solve() {

    REP(i, k){
        xx[x[i]]++;
        yy[y[i]]++;
    }
    LL imos = 0;
    REP(i, m){
        imos += xx[i];
        IMOS[l[i]] += imos * d[i];
        IMOS[r[i]+1] -= imos * d[i];
        imos -= yy[i];
    }
    imos = 0;
    REP(i, n){
        imos += IMOS[i];
        a[i] += imos;
        cout << a[i] << " ";
    }

    cout << endl;
}

int main() {
	init();
    input();
    solve();
	return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())

int n, m, k;
LL a[100010];
int l[100010], r[100010], d[100010], x[100010], y[100010];

int xx[100010], yy[100010];

LL all[400040], part[400040];

void add(int A, int B, LL x, int node, int left, int right){
	if(right<=left) return;
    if(A<=left && right<=B){
		all[node] += x;
		return;
	}
	if(!(right<=A) && !(B<=left)) part[node] += x * (min(right,B) - max(left, A));
	else return;

	int m = (left+right)/2;
	add(A, B, x, node*2+1, left, m);
	add(A, B, x, node*2+2, m, right);

    return;
}

LL sum(int A, int B, int node, int left, int right){
    LL res = 0;
	if(right<=left) return res;
	if(A<=left && right<=B){
		res += part[node];
		res += all[node] * (right-left);
		return res;
	}
	if(!(right<=A) && !(B<=left)) res += all[node] *(min(right,B) - max(left, A));
	else return res;

	int m = (left+right)/2;
	res += sum(A, B, node*2+1, left, m);
	res += sum(A, B, node*2+2, m, right);

    return res;
}

void init() {
    REP(i, 100010){
        xx[i] = 0;
        yy[i] = 0;
    }
}

void input() {
    cin >> n >> m >> k;
    REP(i, n) cin >> a[i];
    REP(i, m) cin >> l[i] >> r[i] >> d[i];
    REP(i, m){
        l[i]--;
        r[i]--;
    }
    REP(i, k) cin >> x[i] >> y[i];
    REP(i, k){
        x[i]--;
        y[i]--;
    }
}

void solve() {
	REP(i, 400040) all[i] = 0;
	REP(i, 400040) part[i] = 0;
    REP(i, n) add(i, i+1, a[i], 0, 0, n);

    REP(i, k){
        xx[x[i]]++;
        yy[y[i]]++;
    }
    int imos = 0;
    REP(i, m){
        imos += xx[i];
        LL dd = d[i] * imos;
        add(l[i], r[i]+1, dd, 0, 0, n);
        imos -= yy[i];
    }
    REP(i, n) cout << sum(i, i+1, 0, 0, n) << " ";
    cout << endl;
}

int main() {
	init();
    input();
    solve();
	return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())

int n, m, k;
LL a[100010];
int l[100010], r[100010], d[100010], x[100010], y[100010];

int xx[100010], yy[100010];

LL all[400040], part[400040];

void add(int A, int B, int x, int node, int left, int right){
	if(right<=left) return;
    if(A<=left && right<=B){
		all[node] += x;
		return;
	}
	if(!(right<=A) && !(B<=left)) part[node] += x * (min(right,B) - max(left, A));
	else return;

	int m = (left+right)/2;
	add(A, B, x, node*2+1, left, m);
	add(A, B, x, node*2+2, m, right);

    return;
}

LL sum(int A, int B, int node, int left, int right){
    LL res = 0;
	if(right<=left) return res;
	if(A<=left && right<=B){
		res += part[node];
		res += all[node] * (right-left);
		return res;
	}
	if(!(right<=A) && !(B<=left)) res += all[node] *(min(right,B) - max(left, A));
	else return res;

	int m = (left+right)/2;
	res += sum(A, B, node*2+1, left, m);
	res += sum(A, B, node*2+2, m, right);

    return res;
}

void init() {
    REP(i, 100010){
        xx[i] = 0;
        yy[i] = 0;
    }
}

void input() {
    cin >> n >> m >> k;
    REP(i, n) cin >> a[i];
    REP(i, m) cin >> l[i] >> r[i] >> d[i];
    REP(i, m){
        l[i]--;
        r[i]--;
    }
    REP(i, k) cin >> x[i] >> y[i];
    REP(i, k){
        x[i]--;
        y[i]--;
    }
}

void solve() {
	REP(i, 400040) all[i] = 0;
	REP(i, 400040) part[i] = 0;
    REP(i, n) add(i, i+1, a[i], 0, 0, n);

    REP(i, k){
        xx[x[i]]++;
        yy[y[i]]++;
    }
    int imos = 0;
    REP(i, m){
        imos += xx[i];
        LL dd = d[i] * imos;
        add(l[i], r[i]+1, dd, 0, 0, n);
        imos -= yy[i];
    }
    REP(i, n) cout << sum(i, i+1, 0, 0, n) << " ";
    cout << endl;
}

int main() {
	init();
    input();
    solve();
	return 0;
}


#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>
#include <cstdarg>
#include <sys/time.h>
#include <fstream>
//#include "cout.h"

using namespace std;

#define SZ(x) ((int)x.size())
#define MSET(x,a) memset(x, a, (int)sizeof(x))
#define PB push_back
#define VI vector < int >
#define PII pair < int, int >
#define LL long long
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()
#define FIT(it,v) for (__typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
#define OUT(A) cout << #A << " = "<< (A) << endl

#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())

int n, m, k;
LL a[100010];
int l[100010], r[100010], d[100010], x[100010], y[100010];

int xx[100010], yy[100010];

LL all[400040], part[400040];

void add(int A, int B, LL x, int node, int left, int right){
	if(right<=left) return;
    if(A<=left && right<=B){
		all[node] += x;
		return;
	}
	if(!(right<=A) && !(B<=left)) part[node] += x * (min(right,B) - max(left, A));
	else return;

	int m = (left+right)/2;
	add(A, B, x, node*2+1, left, m);
	add(A, B, x, node*2+2, m, right);

    return;
}

LL sum(int A, int B, int node, int left, int right){
    LL res = 0;
	if(right<=left) return res;
	if(A<=left && right<=B){
		res += part[node];
		res += all[node] * (right-left);
		return res;
	}
	if(!(right<=A) && !(B<=left)) res += all[node] *(min(right,B) - max(left, A));
	else return res;

	int m = (left+right)/2;
	res += sum(A, B, node*2+1, left, m);
	res += sum(A, B, node*2+2, m, right);

    return res;
}

void init() {
    REP(i, 100010){
        xx[i] = 0;
        yy[i] = 0;
    }
}

void input() {
    cin >> n >> m >> k;
    REP(i, n) cin >> a[i];
    REP(i, m) cin >> l[i] >> r[i] >> d[i];
    REP(i, m){
        l[i]--;
        r[i]--;
    }
    REP(i, k) cin >> x[i] >> y[i];
    REP(i, k){
        x[i]--;
        y[i]--;
    }
}

void solve() {
	REP(i, 400040) all[i] = 0;
	REP(i, 400040) part[i] = 0;
    REP(i, n) add(i, i+1, a[i], 0, 0, n);

    REP(i, k){
        xx[x[i]]++;
        yy[y[i]]++;
    }
    LL imos = 0;
    REP(i, m){
        imos += xx[i];
        LL dd = d[i] * imos;
        add(l[i], r[i]+1, dd, 0, 0, n);
        imos -= yy[i];
    }
    REP(i, n) cout << sum(i, i+1, 0, 0, n) << " ";
    cout << endl;
}

int main() {
	init();
    input();
    solve();
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

long long G[2097154];
long long a[2097154];
long long l[259715],r[259715];
long long  n,m,i,k,p,f,b,c,x,mm;
long long xx[260000],bb[260000],cc[260000],j;

long long sum(int L,int R,int now)
 {
  if (l[now]>R) return 0;
  if (r[now]<L) return 0;
  if (L <= l[now] && r[now] <= R) return a[now];
  G[2*now]+=G[now];
  a[2*now]+=(r[2*now]-l[2*now]+1)*G[now];
  G[2*now+1]+=G[now];
  a[2*now+1]+=(r[2*now+1]-l[2*now+1]+1)*G[now];
  G[now]=0;
  return sum(L,R,2*now)+sum(L,R,2*now+1);
 }

void update(int L,int R,int now,int S)
 {
  if (l[now]>R) return;
  if (r[now]<L) return;
  if (L <= l[now] && r[now] <= R)
   {
    G[now]+=S;
    a[now]+=S*(r[now]-l[now]+1);
    return;
   }
  if (l[now] <= L && R <= r[now])
   {
    a[now]+=(R-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (l[now] <= L && r[now] <= R)
   {
    a[now]+=(r[now]-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (L <= l[now] && R <= r[now])
   {
    a[now]+=(R-l[now]+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
   }
 }

long long TMP[500000];
long long klp;

void up2(int con1,int con2,int l,int r,int now)
 {
  if (con1>r || con2<l) return;
  if (l<=con1 && con2<=r) {TMP[now]++;return;}
  up2(con1,(con1+con2)/2,l,r,2*now);
  up2((con1+con2)/2+1,con2,l,r,2*now+1);
 }

int noww;

main()
 {
  cin>>n>>m>>mm;
  k=1;
  while (k<n) k*=2;
  for (i=1;i<=2*k;i++)
   l[i]=2*k,r[i]=-1;
  k--;
  for (i=1;i<=n;i++)
   cin>>a[k+i];
  for (i=1;i<=k+1;i++)
   {
    p=k+i;
    l[p]=p;
    r[p]=p;
    p/=2;
    while (p>=1)
     {
      l[p]=min(l[p],l[2*p]);
      r[p]=max(r[p],r[2*p+1]);
      p/=2;
     }
   }
  for (i=1;i<=n;i++)
   {
    p=k+i;
    p/=2;
    while (p>=1)
     {
      a[p]=a[2*p]+a[2*p+1];
      p/=2;
     }
   }
  klp=1;
  while (klp <= m) klp*=2;
  klp--;
  for (i=1;i<=m;i++)
   {
      cin>>bb[i]>>cc[i]>>xx[i];
   }

    for (i=1;i<=mm;i++)
   {
    cin>>b>>c;
    up2(klp+1,klp+klp+1,klp+b,klp+c,1);
   }
  for (i=1;i<=m;i++)
   {
    noww=0;
    p=klp+i;
    while (p>=1)
     {
      noww+=TMP[p];
      p/=2;
     }
    update(k+bb[i],k+cc[i],1,xx[i]*noww);
   }

  for (i=1;i<=n;i++) sum(k+i,k+i,1);

  for (i=1;i<=n;i++)
   cout<<a[k+i]<<" ";
  cout<<endl;

 }


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

long long G[2097159];
long long a[2097159];
long long l[2097159],r[2097159];
long long  n,m,i,k,p,f,b,c,x,mm;
long long xx[2097159],bb[2097159],cc[2097159],j;

long long sum(long long L,long long R,long long now)
 {
  if (l[now]>R) return 0LL;
  if (r[now]<L) return 0LL;
  if (L <= l[now] && r[now] <= R) return a[now];
  G[2*now]+=G[now];
  a[2*now]+=(r[2*now]-l[2*now]+1)*G[now];
  G[2*now+1]+=G[now];
  a[2*now+1]+=(r[2*now+1]-l[2*now+1]+1)*G[now];
  G[now]=0LL;
  return sum(L,R,2*now)+sum(L,R,2*now+1);
 }

void update(long long L,long long R,long long now,long long S)
 {
  if (l[now]>R) return;
  if (r[now]<L) return;
  if (L <= l[now] && r[now] <= R)
   {
    G[now]+=S;
    a[now]+=S*(r[now]-l[now]+1);
    return;
   }
  if (l[now] <= L && R <= r[now])
   {
    a[now]+=(R-L+1)*S;
    update(L,R,2LL*now,S);
    update(L,R,2LL*now+1,S);
    return;
   }
  if (l[now] <= L && r[now] <= R)
   {
    a[now]+=(r[now]-L+1)*S;
    update(L,R,2LL*now,S);
    update(L,R,2LL*now+1,S);
    return;
   }
  if (L <= l[now] && R <= r[now])
   {
    a[now]+=(R-l[now]+1)*S;
    update(L,R,2LL*now,S);
    update(L,R,2LL*now+1,S);
   }
 }

long long TMP[2097159];
long long klp;

void up2LL(long long con1,long long con2LL,long long l,long long r,long long now)
 {
  if (con1>r || con2LL<l) return;
  if (l<=con1 && con2LL<=r) {TMP[now]++;return;}
  up2LL(con1,(con1+con2LL)/2LL,l,r,2LL*now);
  up2LL((con1+con2LL)/2LL+1,con2LL,l,r,2LL*now+1);
 }

long long noww;

main()
 {
  cin>>n>>m>>mm;
  k=1;
  while (k<n) k*=2LL;
  for (i=1;i<=2LL*k;i++)
   l[i]=2LL*k,r[i]=-1;
  k--;
  for (i=1;i<=n;i++)
   cin>>a[k+i];
  for (i=1;i<=k+1;i++)
   {
    p=k+i;
    l[p]=p;
    r[p]=p;
    p/=2LL;
    while (p>=1)
     {
      l[p]=min(l[p],l[2LL*p]);
      r[p]=max(r[p],r[2LL*p+1]);
      p/=2LL;
     }
   }
  for (i=1;i<=n;i++)
   {
    p=k+i;
    p/=2LL;
    while (p>=1)
     {
      a[p]=a[2LL*p]+a[2LL*p+1];
      p/=2LL;
     }
   }
  klp=1;
  while (klp <= m) klp*=2LL;
  klp--;
  for (i=1;i<=m;i++)
   {
      cin>>bb[i]>>cc[i]>>xx[i];
   }

    for (i=1;i<=mm;i++)
   {
    cin>>b>>c;
    up2LL(klp+1,klp+klp+1,klp+b,klp+c,1);
   }
  for (i=1;i<=m;i++)
   {
    noww=0LL;
    p=klp+i;
    while (p>=1)
     {
      noww+=TMP[p];
      p/=2LL;
     }
    update(k+bb[i],k+cc[i],1,xx[i]*noww);
   }

  for (i=1;i<=n;i++) sum(k+i,k+i,1);

  for (i=1;i<=n;i++)
   cout<<a[k+i]<<" ";
  cout<<endl;

 }


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

long long G[2097154];
long long a[2097154];
long long l[259715],r[259715];
long long  n,m,i,k,p,f,b,c,x,mm;
long long xx[200000],bb[200000],cc[200000],j;

long long sum(int L,int R,int now)
 {
  if (l[now]>R) return 0;
  if (r[now]<L) return 0;
  if (L <= l[now] && r[now] <= R) return a[now];
  G[2*now]+=G[now];
  a[2*now]+=(r[2*now]-l[2*now]+1)*G[now];
  G[2*now+1]+=G[now];
  a[2*now+1]+=(r[2*now+1]-l[2*now+1]+1)*G[now];
  G[now]=0;
  return sum(L,R,2*now)+sum(L,R,2*now+1);
 }

void update(int L,int R,int now,int S)
 {
  if (l[now]>R) return;
  if (r[now]<L) return;
  if (L <= l[now] && r[now] <= R)
   {
    G[now]+=S;
    a[now]+=S*(r[now]-l[now]+1);
    return;
   }
  if (l[now] <= L && R <= r[now])
   {
    a[now]+=(R-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (l[now] <= L && r[now] <= R)
   {
    a[now]+=(r[now]-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (L <= l[now] && R <= r[now])
   {
    a[now]+=(R-l[now]+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
   }
 }

long long TMP[500000];
long long klp;

void up2(int con1,int con2,int l,int r,int now)
 {
  if (con1>r || con2<l) return;
  if (l<=con1 && con2<=r) {TMP[now]++;return;}
  up2(con1,(con1+con2)/2,l,r,2*now);
  up2((con1+con2)/2+1,con2,l,r,2*now+1);
 }

int noww;

main()
 {
  cin>>n>>m>>mm;
  k=1;
  while (k<n) k*=2;
  for (i=1;i<=2*k;i++)
   l[i]=2*k,r[i]=-1;
  k--;
  for (i=1;i<=n;i++)
   cin>>a[k+i];
  for (i=1;i<=k+1;i++)
   {
    p=k+i;
    l[p]=p;
    r[p]=p;
    p/=2;
    while (p>=1)
     {
      l[p]=min(l[p],l[2*p]);
      r[p]=max(r[p],r[2*p+1]);
      p/=2;
     }
   }
  for (i=1;i<=n;i++)
   {
    p=k+i;
    p/=2;
    while (p>=1)
     {
      a[p]=a[2*p]+a[2*p+1];
      p/=2;
     }
   }
  klp=1;
  while (klp <= m) klp*=2;
  klp--;
  for (i=1;i<=m;i++)
   {
      cin>>bb[i]>>cc[i]>>xx[i];
   }

    for (i=1;i<=mm;i++)
   {
    cin>>b>>c;
    up2(klp+1,klp+klp+1,klp+b,klp+c,1);
   }
  for (i=1;i<=m;i++)
   {
    noww=0;
    p=klp+i;
    while (p>=1)
     {
      noww+=TMP[p];
      p/=2;
     }
    update(k+bb[i],k+cc[i],1,xx[i]*noww);
   }

  for (i=1;i<=n;i++) sum(k+i,k+i,1);

  for (i=1;i<=n;i++)
   cout<<a[k+i]<<" ";
  cout<<endl;

 }


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

long long G[2097154];
long long a[2097154];
long long l[259715],r[259715];
long long  n,m,i,k,p,f,b,c,x,mm;
long long xx[260000],bb[260000],cc[260000],j;

long long sum(long long L,long long R,long long now)
 {
  if (l[now]>R) return 0;
  if (r[now]<L) return 0;
  if (L <= l[now] && r[now] <= R) return a[now];
  G[2*now]+=G[now];
  a[2*now]+=(r[2*now]-l[2*now]+1)*G[now];
  G[2*now+1]+=G[now];
  a[2*now+1]+=(r[2*now+1]-l[2*now+1]+1)*G[now];
  G[now]=0;
  return sum(L,R,2*now)+sum(L,R,2*now+1);
 }

void update(long long L,long long R,long long now,long long S)
 {
  if (l[now]>R) return;
  if (r[now]<L) return;
  if (L <= l[now] && r[now] <= R)
   {
    G[now]+=S;
    a[now]+=S*(r[now]-l[now]+1);
    return;
   }
  if (l[now] <= L && R <= r[now])
   {
    a[now]+=(R-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (l[now] <= L && r[now] <= R)
   {
    a[now]+=(r[now]-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (L <= l[now] && R <= r[now])
   {
    a[now]+=(R-l[now]+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
   }
 }

long long TMP[500000];
long long klp;

void up2(long long con1,long long con2,long long l,long long r,long long now)
 {
  if (con1>r || con2<l) return;
  if (l<=con1 && con2<=r) {TMP[now]++;return;}
  up2(con1,(con1+con2)/2,l,r,2*now);
  up2((con1+con2)/2+1,con2,l,r,2*now+1);
 }

long long noww;

main()
 {
  cin>>n>>m>>mm;
  k=1;
  while (k<n) k*=2;
  for (i=1;i<=2*k;i++)
   l[i]=2*k,r[i]=-1;
  k--;
  for (i=1;i<=n;i++)
   cin>>a[k+i];
  for (i=1;i<=k+1;i++)
   {
    p=k+i;
    l[p]=p;
    r[p]=p;
    p/=2;
    while (p>=1)
     {
      l[p]=min(l[p],l[2*p]);
      r[p]=max(r[p],r[2*p+1]);
      p/=2;
     }
   }
  for (i=1;i<=n;i++)
   {
    p=k+i;
    p/=2;
    while (p>=1)
     {
      a[p]=a[2*p]+a[2*p+1];
      p/=2;
     }
   }
  klp=1;
  while (klp <= m) klp*=2;
  klp--;
  for (i=1;i<=m;i++)
   {
      cin>>bb[i]>>cc[i]>>xx[i];
   }

    for (i=1;i<=mm;i++)
   {
    cin>>b>>c;
    up2(klp+1,klp+klp+1,klp+b,klp+c,1);
   }
  for (i=1;i<=m;i++)
   {
    noww=0;
    p=klp+i;
    while (p>=1)
     {
      noww+=TMP[p];
      p/=2;
     }
    update(k+bb[i],k+cc[i],1,xx[i]*noww);
   }

  for (i=1;i<=n;i++) sum(k+i,k+i,1);

  for (i=1;i<=n;i++)
   cout<<a[k+i]<<" ";
  cout<<endl;

 }


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

long long G[2097154];
long long a[2097154];
long long l[259715],r[259715];
long long  n,m,i,k,p,f,b,c,x,mm;
long long xx[260000],bb[260000],cc[260000],j;

long long sum(long long L,long long R,long long now)
 {
  if (l[now]>R) return 0LL;
  if (r[now]<L) return 0LL;
  if (L <= l[now] && r[now] <= R) return a[now];
  G[2*now]+=G[now];
  a[2*now]+=(r[2*now]-l[2*now]+1)*G[now];
  G[2*now+1]+=G[now];
  a[2*now+1]+=(r[2*now+1]-l[2*now+1]+1)*G[now];
  G[now]=0LL;
  return sum(L,R,2*now)+sum(L,R,2*now+1);
 }

void update(long long L,long long R,long long now,long long S)
 {
  if (l[now]>R) return;
  if (r[now]<L) return;
  if (L <= l[now] && r[now] <= R)
   {
    G[now]+=S;
    a[now]+=S*(r[now]-l[now]+1);
    return;
   }
  if (l[now] <= L && R <= r[now])
   {
    a[now]+=(R-L+1)*S;
    update(L,R,2LL*now,S);
    update(L,R,2LL*now+1,S);
    return;
   }
  if (l[now] <= L && r[now] <= R)
   {
    a[now]+=(r[now]-L+1)*S;
    update(L,R,2LL*now,S);
    update(L,R,2LL*now+1,S);
    return;
   }
  if (L <= l[now] && R <= r[now])
   {
    a[now]+=(R-l[now]+1)*S;
    update(L,R,2LL*now,S);
    update(L,R,2LL*now+1,S);
   }
 }

long long TMP[611111];
long long klp;

void up2LL(long long con1,long long con2LL,long long l,long long r,long long now)
 {
  if (con1>r || con2LL<l) return;
  if (l<=con1 && con2LL<=r) {TMP[now]++;return;}
  up2LL(con1,(con1+con2LL)/2LL,l,r,2LL*now);
  up2LL((con1+con2LL)/2LL+1,con2LL,l,r,2LL*now+1);
 }

long long noww;

main()
 {
  cin>>n>>m>>mm;
  k=1;
  while (k<n) k*=2LL;
  for (i=1;i<=2LL*k;i++)
   l[i]=2LL*k,r[i]=-1;
  k--;
  for (i=1;i<=n;i++)
   cin>>a[k+i];
  for (i=1;i<=k+1;i++)
   {
    p=k+i;
    l[p]=p;
    r[p]=p;
    p/=2LL;
    while (p>=1)
     {
      l[p]=min(l[p],l[2LL*p]);
      r[p]=max(r[p],r[2LL*p+1]);
      p/=2LL;
     }
   }
  for (i=1;i<=n;i++)
   {
    p=k+i;
    p/=2LL;
    while (p>=1)
     {
      a[p]=a[2LL*p]+a[2LL*p+1];
      p/=2LL;
     }
   }
  klp=1;
  while (klp <= m) klp*=2LL;
  klp--;
  for (i=1;i<=m;i++)
   {
      cin>>bb[i]>>cc[i]>>xx[i];
   }

    for (i=1;i<=mm;i++)
   {
    cin>>b>>c;
    up2LL(klp+1,klp+klp+1,klp+b,klp+c,1);
   }
  for (i=1;i<=m;i++)
   {
    noww=0LL;
    p=klp+i;
    while (p>=1)
     {
      noww+=TMP[p];
      p/=2LL;
     }
    update(k+bb[i],k+cc[i],1,xx[i]*noww);
   }

  for (i=1;i<=n;i++) sum(k+i,k+i,1);

  for (i=1;i<=n;i++)
   cout<<a[k+i]<<" ";
  cout<<endl;

 }


#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>

using namespace std;

long long G[2097154];
long long a[2097154];
long long l[259715],r[259715];
long long  n,m,i,k,p,f,b,c,x,mm;
long long xx[200000],bb[200000],cc[200000],j;

long long sum(int L,int R,int now)
 {
  if (l[now]>R) return 0;
  if (r[now]<L) return 0;
  if (L <= l[now] && r[now] <= R) return a[now];
  G[2*now]+=G[now];
  a[2*now]+=(r[2*now]-l[2*now]+1)*G[now];
  G[2*now+1]+=G[now];
  a[2*now+1]+=(r[2*now+1]-l[2*now+1]+1)*G[now];
  G[now]=0;
  return sum(L,R,2*now)+sum(L,R,2*now+1);
 }

void update(int L,int R,int now,int S)
 {
  if (l[now]>R) return;
  if (r[now]<L) return;
  if (L <= l[now] && r[now] <= R)
   {
    G[now]+=S;
    a[now]+=S*(r[now]-l[now]+1);
    return;
   }
  if (l[now] <= L && R <= r[now])
   {
    a[now]+=(R-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (l[now] <= L && r[now] <= R)
   {
    a[now]+=(r[now]-L+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
    return;
   }
  if (L <= l[now] && R <= r[now])
   {
    a[now]+=(R-l[now]+1)*S;
    update(L,R,2*now,S);
    update(L,R,2*now+1,S);
   }
 }

long long TMP[500000];
long long klp;

void up2(int con1,int con2,int l,int r,int now)
 {
  if (con1>r || con2<l) return;
  if (l<=con1 && con2<=r) {TMP[now]++;return;}
  up2(con1,(con1+con2)/2,l,r,2*now);
  up2((con1+con2)/2+1,con2,l,r,2*now+1);
 }

long long noww;

main()
 {
  cin>>n>>m>>mm;
  k=1;
  while (k<n) k*=2;
  for (i=1;i<=2*k;i++)
   l[i]=2*k,r[i]=-1;
  k--;
  for (i=1;i<=n;i++)
   cin>>a[k+i];
  for (i=1;i<=k+1;i++)
   {
    p=k+i;
    l[p]=p;
    r[p]=p;
    p/=2;
    while (p>=1)
     {
      l[p]=min(l[p],l[2*p]);
      r[p]=max(r[p],r[2*p+1]);
      p/=2;
     }
   }
  for (i=1;i<=n;i++)
   {
    p=k+i;
    p/=2;
    while (p>=1)
     {
      a[p]=a[2*p]+a[2*p+1];
      p/=2;
     }
   }
  klp=1;
  while (klp <= m) klp*=2;
  klp--;
  for (i=1;i<=m;i++)
   {
      cin>>bb[i]>>cc[i]>>xx[i];
   }

    for (i=1;i<=mm;i++)
   {
    cin>>b>>c;
    up2(klp+1,klp+klp+1,klp+b,klp+c,1);
   }
  for (i=1;i<=m;i++)
   {
    noww=0;
    p=klp+i;
    while (p>=1)
     {
      noww+=TMP[p];
      p/=2;
     }
    update(k+bb[i],k+cc[i],1,xx[i]*noww);
   }

  for (i=1;i<=n;i++) sum(k+i,k+i,1);

  for (i=1;i<=n;i++)
   cout<<a[k+i]<<" ";
  cout<<endl;

 }


//{{{
#define DEF
#ifdef DEF
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <stack>
#include <vector>
#include <list>
#include <map>
#include <cctype>
#include <queue>
#include <cstring>
#include <cmath>
#include <set>
#include <deque>

//-----------------------------------------------------

using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ullint;

typedef pair<int,int> Pii;
typedef pair<llint,llint> Pll;

#define mrepp(i,n,x)  for(llint i = n-1; i >= x; i--)
#define mrep(i,n) mrepp(i,n,0)
#define repp(i,x,n)  for(int i = x; i < n; i++)
#define rep(i,n) repp(i,0,n)
#define pb        push_back
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
//#define reach(i,c) for(__typeof((c).rbegin()) i=(c).rbegin();i!=(c).rend();i++)
#define fst         first
#define scd         second

#define sz(v)     ((llint)(v).size())
//#define bit(n)    (1ll<<(li)(n))
//#define mkP        make_pair

//-----------------------------------------------------
#endif
//}}}

int N,M,K;
llint a[100010];
llint q[100010];
int opl[10010];
int opr[10010];
int opd[10010];

int main(){
	cin >> N >> M >> K;
	rep(i,N) cin >> a[i];
	rep(i,M) cin >> opl[i] >> opr[i] >> opd[i];

	rep(i,K){
		int x,y; cin >> x >> y;
		q[x-1]++;
		q[y]--;
	}
	//rep(i,K) cout << q[i] << (i==K-1?'\n':' ');

	int ap_num = 0;
	rep(i,M){
		ap_num += q[i];
		repp(x,opl[i]-1,opr[i])
			a[x] += (llint)opd[i]*ap_num;
	}
	rep(i,N) cout << a[i] << (i==N-1?'\n':' ');
	return 0;
}


//{{{
#define DEF
#ifdef DEF
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <stack>
#include <vector>
#include <list>
#include <map>
#include <cctype>
#include <queue>
#include <cstring>
#include <cmath>
#include <set>
#include <deque>

//-----------------------------------------------------

using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ullint;

typedef pair<int,int> Pii;
typedef pair<llint,llint> Pll;

#define mrepp(i,n,x)  for(int i = n-1; i >= x; i--)
#define mrep(i,n) mrepp(i,n,0)
#define repp(i,x,n)  for(int i = x; i < n; i++)
#define rep(i,n) repp(i,0,n)
#define pb        push_back
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
//#define reach(i,c) for(__typeof((c).rbegin()) i=(c).rbegin();i!=(c).rend();i++)
#define fst         first
#define scd         second

#define sz(v)     ((llint)(v).size())
//#define bit(n)    (1ll<<(li)(n))
//#define mkP        make_pair

//-----------------------------------------------------
#endif
//}}}

int N,M,K;
llint a[100010];
int q[100010];
int opl[10010];
int opr[10010];
int opd[10010];

int main(){
	cin >> N >> M >> K;
	rep(i,N) cin >> a[i];
	rep(i,M) cin >> opl[i] >> opr[i] >> opd[i];

	rep(i,K){
		int x,y; cin >> x >> y;
		q[x-1]++;
		q[y]--;
	}
	//rep(i,K) cout << q[i] << (i==K-1?'\n':' ');

	int ap_num = 0;
	rep(i,M){
		ap_num += q[i];
		repp(x,opl[i]-1,opr[i])
			a[x] += opd[i]*ap_num;
	}
	rep(i,N) cout << a[i] << (i==N-1?'\n':' ');
	return 0;
}


//{{{
#define DEF
#ifdef DEF
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <stack>
#include <vector>
#include <list>
#include <map>
#include <cctype>
#include <queue>
#include <cstring>
#include <cmath>
#include <set>
#include <deque>

//-----------------------------------------------------

using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ullint;

typedef pair<int,int> Pii;
typedef pair<llint,llint> Pll;

#define mrepp(i,n,x)  for(llint i = n-1; i >= x; i--)
#define mrep(i,n) mrepp(i,n,0)
#define repp(i,x,n)  for(llint i = x; i < n; i++)
#define rep(i,n) repp(i,0,n)
#define pb        push_back
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
//#define reach(i,c) for(__typeof((c).rbegin()) i=(c).rbegin();i!=(c).rend();i++)
#define fst         first
#define scd         second

#define sz(v)     ((llint)(v).size())
//#define bit(n)    (1ll<<(li)(n))
//#define mkP        make_pair

//-----------------------------------------------------
#endif
//}}}

int N,M,K;
llint a[100010];
llint q[100010];
int opl[100010];
int opr[100010];
int opd[100010];
llint imos_a[100010];

int main(){
	cin >> N >> M >> K;
	rep(i,N) cin >> a[i];
	rep(i,M){ cin >> opl[i] >> opr[i] >> opd[i]; opl[i]--;}

	rep(i,K){
		int x,y; cin >> x >> y;
		q[x-1]++;
		q[y]--;
	}

	llint ap_num = 0;
	rep(i,M){
		ap_num += q[i];
		imos_a[ opl[i] ] += ap_num * opd[i];
		imos_a[ opr[i] ] -= ap_num * opd[i];
	}

	llint ap = 0;
	rep(i,N){
		ap += imos_a[i];
		cout << ap+a[i] << (i==N-1?'\n':' ');
	}
	return 0;
}


//{{{
#define DEF
#ifdef DEF
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <stack>
#include <vector>
#include <list>
#include <map>
#include <cctype>
#include <queue>
#include <cstring>
#include <cmath>
#include <set>
#include <deque>

//-----------------------------------------------------

using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ullint;

typedef pair<int,int> Pii;
typedef pair<llint,llint> Pll;

#define mrepp(i,n,x)  for(int i = n-1; i >= x; i--)
#define mrep(i,n) mrepp(i,n,0)
#define repp(i,x,n)  for(int i = x; i < n; i++)
#define rep(i,n) repp(i,0,n)
#define pb        push_back
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define reach(i,c) for(__typeof((c).rbegin()) i=(c).rbegin();i!=(c).rend();i++)
#define fst         first
#define scd         second

#define sz(v)     ((llint)(v).size())
//#define bit(n)    (1ll<<(li)(n))
//#define mkP        make_pair

//-----------------------------------------------------
#endif
//}}}

int N;
const int MAX_N = 600;
llint cost[MAX_N][MAX_N];
int c[MAX_N];
vector<llint> ans;

int main(){

	cin >> N;
	rep(i,N) rep(j,N) cin>> cost[i][j];
	rep(i,N){
		int a;cin >> a;
		c[N-i-1] = a-1;
	}

	rep(k,N){
		rep(i,N) rep(j,N) cost[c[i]][c[j]] = min(cost[c[i]][c[j]],cost[c[i]][c[k]]+cost[c[k]][c[j]]);
		llint sum = 0;
		rep(i,k+1) rep(j,k+1) sum += cost[c[i]][c[j]];
		ans.pb(sum);
	}

	reach(i,ans) cout << *i << (i+1==ans.rend()?'\n':' ');

	return 0;
}


//{{{
#define DEF
#ifdef DEF
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <stack>
#include <vector>
#include <list>
#include <map>
#include <cctype>
#include <queue>
#include <cstring>
#include <cmath>
#include <set>
#include <deque>

//-----------------------------------------------------

using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ullint;

typedef pair<int,int> Pii;
typedef pair<llint,llint> Pll;

#define mrepp(i,n,x)  for(llint i = n-1; i >= x; i--)
#define mrep(i,n) mrepp(i,n,0)
#define repp(i,x,n)  for(llint i = x; i < n; i++)
#define rep(i,n) repp(i,0,n)
#define pb        push_back
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
//#define reach(i,c) for(__typeof((c).rbegin()) i=(c).rbegin();i!=(c).rend();i++)
#define fst         first
#define scd         second

#define sz(v)     ((llint)(v).size())
//#define bit(n)    (1ll<<(li)(n))
//#define mkP        make_pair

//-----------------------------------------------------
#endif
//}}}

int N,M,K;
llint a[100010];
llint q[100010];
int opl[100010];
int opr[100010];
int opd[100010];

int main(){
	cin >> N >> M >> K;
	rep(i,N) cin >> a[i];
	rep(i,M) cin >> opl[i] >> opr[i] >> opd[i];

	rep(i,K){
		int x,y; cin >> x >> y;
		q[x-1]++;
		q[y]--;
	}
	//rep(i,K) cout << q[i] << (i==K-1?'\n':' ');

	int ap_num = 0;
	rep(i,M){
		ap_num += q[i];
		repp(x,opl[i]-1,opr[i])
			a[x] += (llint)opd[i]*ap_num;
	}
	rep(i,N) cout << a[i] << (i==N-1?'\n':' ');
	return 0;
}


//{{{
#define DEF
#ifdef DEF
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <stack>
#include <vector>
#include <list>
#include <map>
#include <cctype>
#include <queue>
#include <cstring>
#include <cmath>
#include <set>
#include <deque>

//-----------------------------------------------------

using namespace std;
typedef unsigned int uint;
typedef long long int llint;
typedef unsigned long long int ullint;

typedef pair<int,int> Pii;
typedef pair<llint,llint> Pll;

#define mrepp(i,n,x)  for(llint i = n-1; i >= x; i--)
#define mrep(i,n) mrepp(i,n,0)
#define repp(i,x,n)  for(llint i = x; i < n; i++)
#define rep(i,n) repp(i,0,n)
#define pb        push_back
#define all(vec)  (vec).begin(),(vec).end()
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
//#define reach(i,c) for(__typeof((c).rbegin()) i=(c).rbegin();i!=(c).rend();i++)
#define fst         first
#define scd         second

#define sz(v)     ((llint)(v).size())
//#define bit(n)    (1ll<<(li)(n))
//#define mkP        make_pair

//-----------------------------------------------------
#endif
//}}}

int N,M,K;
llint a[100010];
llint q[100010];
int opl[100010];
int opr[100010];
int opd[100010];
int imos_a[100010];

int main(){
	cin >> N >> M >> K;
	rep(i,N) cin >> a[i];
	rep(i,M){ cin >> opl[i] >> opr[i] >> opd[i]; opl[i]--;}

	rep(i,K){
		int x,y; cin >> x >> y;
		q[x-1]++;
		q[y]--;
	}

	int ap_num = 0;
	rep(i,M){
		ap_num += q[i];
		imos_a[ opl[i] ] += ap_num * opd[i];
		imos_a[ opr[i] ] -= ap_num * opd[i];
	}

	int ap = 0;
	rep(i,N){
		ap += imos_a[i];
		cout << ap+a[i] << (i==N-1?'\n':' ');
	}
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
#define M 100005
using namespace std;
long long a[M],b[M];
long long L[M],r[M],d[M],op[M];
int main()
{
    int n,m,k,i,x,y;
    //freopen("in","r",stdin);
     cin>>n>>m>>k;
     memset(op,0,sizeof(op));
     memset(b,0,sizeof(b));
    for(i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(i=1;i<=m;i++)
    scanf("%I64d %I64d %I64d",&L[i],&r[i],&d[i]);
    for(i=0;i<k;i++)
    {
        cin>>x>>y;
        op[x]++;op[y+1]--;
    }
    for(i=1;i<=m;i++)
    op[i]+=op[i-1];
    for(i=1;i<=m;i++)
    {
        long long val=d[i]*op[i];
        b[L[i]]+=val;
        b[r[i]+1]-=val;
    }
    for(i=1;i<=n;i++)
    {
        b[i]+=b[i-1];
        a[i]+=b[i];
    }
    for(i=1;i<=n;i++)
    {
        if(i==1)printf("%I64d",a[i]);
        else printf("% I64d",a[i]);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
#define M 100005
using namespace std;
long long a[M];
int L[M];
int r[M];
int d[M];
int num[M];
int main()
{
    int n,m,k,i,x,y,j;
    cin>>n>>m>>k;
     memset(num,0,sizeof(num));
    for(i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(i=1;i<=m;i++)
    cin>>L[i]>>r[i]>>d[i];
    for(i=0;i<k;i++)
    {
        cin>>x>>y;
        for(j=x;j<=y;j++)
        num[j]++;
    }
    for(i=1;i<=m;i++)
    {
        for(j=L[i];j<=r[i];j++)
        a[j]+=d[i]*num[i];
    }
    for(i=1;i<=n;i++)
    {
        if(i==1)printf("%I64d",a[i]);
        else printf("% I64d",a[i]);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#define maxn 100005
using namespace std;
long long v[maxn];
struct Node
{
    int l,r;
    long long sum;
    long long lz;
}node[2][maxn << 2];
long long num[maxn];
void make_tree(int p,int a,int b,long long *v,Node *node)
{
    node[p].l=a;node[p].r=b;
    node[p].lz=0;
    if(a==b)
    {
        node[p].sum=v[a];
        return;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    make_tree(lson,a,mid,v,node);
    make_tree(rson,mid+1,b,v,node);
    node[p].sum=node[lson].sum+node[rson].sum;
}
void modify(int p,int a,int b,int x,Node *node)
{
    if(node[p].l==a&&node[p].r==b)
    {
        node[p].sum+=(b-a+1)*x;
        node[p].lz+=x;//wa了N次
        return;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    if(node[p].lz!=0)
    {
        node[lson].sum+=(node[lson].r-node[lson].l+1)*node[p].lz;
        node[lson].lz+=node[p].lz;
        node[rson].sum+=(node[rson].r-node[rson].l+1)*node[p].lz;
        node[rson].lz+=node[p].lz;
        node[p].lz=0;
    }
    if(b<=mid) modify(lson,a,b,x,node);
    else if(a>=mid+1) modify(rson,a,b,x,node);
    else
    {
        modify(lson,a,mid,x,node);
        modify(rson,mid+1,b,x,node);
    }
    node[p].sum=node[lson].sum+node[rson].sum;
}
long long query(int p,int a,int b,Node *node)
{
    if(node[p].l==a&&node[p].r==b)
    {
        return node[p].sum;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    if(node[p].lz!=0)
    {
        node[lson].sum+=(node[lson].r-node[lson].l+1)*node[p].lz;
        node[lson].lz+=node[p].lz;
        node[rson].sum+=(node[rson].r-node[rson].l+1)*node[p].lz;
        node[rson].lz+=node[p].lz;
        node[p].lz=0;
    }
    if(b<=mid)return query(lson,a,b,node);
    else if(a>=mid+1)return query(rson,a,b,node);
    else return query(lson,a,mid,node)+query(rson,mid+1,b,node);
}
struct Operation
{
    int l,r;
    long long d;
}oper[maxn];

int main()
{
    int n,m,k;
    //freopen("in","r",stdin);
    while(scanf("%d %d %d",&n,&m,&k)!=EOF)
    {
        for(int i=1;i<=n;i++)
        scanf("%I64d",&v[i]);
        make_tree(1,1,n,v,node[0]);

        for(int i=1;i<=m;i++)
        scanf("%d %d %I64d",&oper[i].l,&oper[i].r,&oper[i].d);

        memset(num,0,sizeof(num));
        make_tree(1,1,m,num,node[1]);
        for(int i=0;i<k;i++)
        {
            int x,y;
            scanf("%d %d",&x,&y);
            modify(1,x,y,1,node[1]);
        }
        for(int i=1;i<=m;i++)
        num[i]=query(1,i,i,node[1]);

        for(int i=1;i<=m;i++)
        oper[i].d*=num[i];

        for(int i=1;i<=m;i++)
        modify(1,oper[i].l,oper[i].r,oper[i].d,node[0]);

        for(int i=1;i<=n;i++)
        v[i]=query(1,i,i,node[0]);

        for(int i=1;i<=n;i++)
        {
            if(i==1)printf("%I64d",v[i]);
            else printf(" %I64d",v[i]);
        }
        printf("\n");
    }
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
#define M 100005
using namespace std;
long long a[M];
int L[M];
int r[M];
int d[M];
int num[M];
int main()
{
    int n,m,k,i,x,y,j;
    freopen("in","r",stdin);
     scanf("%d %d %d",&n,&m,&k);
     memset(num,0,sizeof(num));
    for(i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(i=1;i<=m;i++)
    scanf("%d %d %d",&L[i],&r[i],&d[i]);
    for(i=0;i<k;i++)
    {
        scanf("%d %d",&x,&y);
        for(j=x;j<=y;j++)
        num[j]++;
    }
    for(i=1;i<=m;i++)
    {
        for(j=L[i];j<=r[i];j++)
        a[j]+=d[i]*num[i];
    }
    for(i=1;i<=n;i++)
    {
        if(i==1)printf("%I64d",a[i]);
        else printf("% I64d",a[i]);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
#define M 100005
using namespace std;
long long a[M],b[M];
int L[M],r[M],d[M],op[M];
int main()
{
    int n,m,k,i,x,y;
    //freopen("in","r",stdin);
     cin>>n>>m>>k;
     memset(op,0,sizeof(op));
     memset(b,0,sizeof(b));
    for(i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(i=1;i<=m;i++)
    scanf("%d %d %d",&L[i],&r[i],&d[i]);
    for(i=0;i<k;i++)
    {
        cin>>x>>y;
        op[x]++;op[y+1]--;
    }
    for(i=1;i<=m;i++)
    op[i]+=op[i-1];
    for(i=1;i<=m;i++)
    {
        long long val=d[i]*op[i];
        b[L[i]]+=val;
        b[r[i]+1]-=val;
    }
    for(i=1;i<=n;i++)
    {
        b[i]+=b[i-1];
        a[i]+=b[i];
    }
    for(i=1;i<=n;i++)
    {
        if(i==1)printf("%I64d",a[i]);
        else printf("% I64d",a[i]);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
using namespace std;
const int maxn=1e5+10;
long long v[maxn];
struct Node
{
    int l,r;
    long long sum;
    long long lz;
}node[2][maxn << 2];

struct Operation
{
    int l,r;
    long long d;
}oper[maxn];

long long num[maxn];
void make_tree(int p,int a,int b,long long *v,Node *node)
{
    node[p].l=a;node[p].r=b;
    node[p].lz=0;
    if(a==b)
    {
        node[p].sum=v[a];
        return;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    make_tree(lson,a,mid,v,node);
    make_tree(rson,mid+1,b,v,node);
    node[p].sum=node[lson].sum+node[rson].sum;
}
void modify(int p,int a,int b,long long x,Node *node)
{
    if(node[p].l==a&&node[p].r==b)
    {
        node[p].sum+=(b-a+1)*x;
        node[p].lz+=x;//wa了N次
        return;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    if(node[p].lz!=0)
    {
        node[lson].sum+=(node[lson].r-node[lson].l+1)*node[p].lz;
        node[lson].lz+=node[p].lz;
        node[rson].sum+=(node[rson].r-node[rson].l+1)*node[p].lz;
        node[rson].lz+=node[p].lz;
        node[p].lz=0;
    }
    if(b<=mid) modify(lson,a,b,x,node);
    else if(a>=mid+1) modify(rson,a,b,x,node);
    else
    {
        modify(lson,a,mid,x,node);
        modify(rson,mid+1,b,x,node);
    }
    node[p].sum=node[lson].sum+node[rson].sum;
}
long long query(int p,int a,int b,Node *node)
{
    if(node[p].l==a&&node[p].r==b)
    {
        return node[p].sum;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    if(node[p].lz!=0)
    {
        node[lson].sum+=(node[lson].r-node[lson].l+1)*node[p].lz;
        node[lson].lz+=node[p].lz;
        node[rson].sum+=(node[rson].r-node[rson].l+1)*node[p].lz;
        node[rson].lz+=node[p].lz;
        node[p].lz=0;
    }
    if(b<=mid)return query(lson,a,b,node);
    else if(a>=mid+1)return query(rson,a,b,node);
    else return query(lson,a,mid,node)+query(rson,mid+1,b,node);
}

int main()
{
    int n,m,k;
    //freopen("in","r",stdin);
    while(scanf("%d %d %d",&n,&m,&k)!=EOF)
    {
        for(int i=1;i<=n;i++)
        scanf("%I64d",&v[i]);
        make_tree(1,1,n,v,node[0]);

        for(int i=1;i<=m;i++)
        scanf("%d %d %I64d",&oper[i].l,&oper[i].r,&oper[i].d);

        memset(num,0,sizeof(num));
        make_tree(1,1,m,num,node[1]);
        for(int i=0;i<k;i++)
        {
            int x,y;
            scanf("%d %d",&x,&y);
            modify(1,x,y,1,node[1]);
        }
        for(int i=1;i<=m;i++)
        num[i]=query(1,i,i,node[1]);

        for(int i=1;i<=m;i++)
        oper[i].d*=num[i];

        for(int i=1;i<=m;i++)
        modify(1,oper[i].l,oper[i].r,oper[i].d,node[0]);

        for(int i=1;i<=n;i++)
        v[i]=query(1,i,i,node[0]);

        for(int i=1;i<=n;i++)
        {
            if(i==1)printf("%I64d",v[i]);
            else printf(" %I64d",v[i]);
        }
        printf("\n");
    }
	return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
#define M 100005
using namespace std;
long long a[M];
int L[M];
int r[M];
int d[M];
int main()
{
    int n,m,k,i,x,y,j,p;
     cin>>n>>m>>k;
    for(i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(i=1;i<=m;i++)
    cin>>L[i]>>r[i]>>d[i];
    for(i=0;i<k;i++)
    {
        cin>>x>>y;
        for(j=x;j<=y;j++)
        {
            for(p=L[j];p<=r[j];p++)
            a[p]+=d[j];
        }
    }
    for(i=1;i<=n;i++)
    {
        if(i==1)printf("%I64d",a[i]);
        else printf("% I64d",a[i]);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<algorithm>
#include<string.h>
#define M 100005
using namespace std;
long long a[M];
int L[M];
int r[M];
int d[M];
int num[M];
int main()
{
    int n,m,k,i,x,y,j;
     scanf("%d %d %d",&n,&m,&k);
     memset(num,0,sizeof(num));
    for(i=1;i<=n;i++)scanf("%I64d",&a[i]);
    for(i=1;i<=m;i++)
    scanf("%d %d %d",&L[i],&r[i],&d[i]);
    for(i=0;i<k;i++)
    {
        scanf("%d %d",&x,&y);
        for(j=x;j<=y;j++)
        num[j]++;
    }
    for(i=1;i<=m;i++)
    {
        for(j=L[i];j<=r[i];j++)
        a[j]+=d[i]*num[i];
    }
    for(i=1;i<=n;i++)
    {
        if(i==1)printf("%I64d",a[i]);
        else printf("% I64d",a[i]);
    }
    printf("\n");
    return 0;
}


#include<iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#define maxn 100005
using namespace std;
long long v[maxn];
struct Node
{
    int l,r;
    long long sum;
    long long lz;
}node[2][maxn << 2];
long long num[maxn];
void make_tree(int p,int a,int b,long long *v,Node *node)
{
    node[p].l=a;node[p].r=b;
    node[p].lz=0;
    if(a==b)
    {
        node[p].sum=v[a];
        return;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    make_tree(lson,a,mid,v,node);
    make_tree(rson,mid+1,b,v,node);
    node[p].sum=node[lson].sum+node[rson].sum;
}
void modify(int p,int a,int b,int x,Node *node)
{
    if(node[p].l==a&&node[p].r==b)
    {
        node[p].sum+=(b-a+1)*x;
        node[p].lz+=x;//wa了N次
        return;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    if(node[p].lz!=0)
    {
        node[lson].sum+=(node[lson].r-node[lson].l+1)*node[p].lz;
        node[lson].lz+=node[p].lz;
        node[rson].sum+=(node[rson].r-node[rson].l+1)*node[p].lz;
        node[rson].lz+=node[p].lz;
        node[p].lz=0;
    }
    if(b<=mid) modify(lson,a,b,x,node);
    else if(a>=mid+1) modify(rson,a,b,x,node);
    else
    {
        modify(lson,a,mid,x,node);
        modify(rson,mid+1,b,x,node);
    }
    node[p].sum=node[lson].sum+node[rson].sum;
}
long long query(int p,int a,int b,Node *node)
{
    if(node[p].l==a&&node[p].r==b)
    {
        return node[p].sum;
    }
    int lson=p << 1,rson=lson+1;
    int mid=(node[p].l+node[p].r) >> 1;
    if(node[p].lz!=0)
    {
        node[lson].sum+=(node[lson].r-node[lson].l+1)*node[p].lz;
        node[lson].lz+=node[p].lz;
        node[rson].sum+=(node[rson].r-node[rson].l+1)*node[p].lz;
        node[rson].lz+=node[p].lz;
        node[p].lz=0;
    }
    if(b<=mid)return query(lson,a,b,node);
    else if(a>=mid+1)return query(rson,a,b,node);
    else return query(lson,a,mid,node)+query(rson,mid+1,b,node);
}
struct Operation
{
    int l,r;
    long long d;
}oper[maxn];

int main()
{
    int n,m,k;
    //freopen("in","r",stdin);
    while(scanf("%d %d %d",&n,&m,&k)!=EOF)
    {
        for(int i=1;i<=n;i++)
        scanf("%I64d",&v[i]);
        make_tree(1,1,n,v,node[0]);

        for(int i=1;i<=m;i++)
        scanf("%d %d %I64d",&oper[i].l,&oper[i].r,&oper[i].d);

        make_tree(1,1,m,num,node[1]);
        for(int i=0;i<k;i++)
        {
            int x,y;
            scanf("%d %d",&x,&y);
            modify(1,x,y,1,node[1]);
        }
        for(int i=1;i<=m;i++)
        num[i]=query(1,i,i,node[1]);

        for(int i=1;i<=m;i++)
        oper[i].d*=num[i];

        for(int i=1;i<=m;i++)
        modify(1,oper[i].l,oper[i].r,oper[i].d,node[0]);

        for(int i=1;i<=n;i++)
        v[i]=query(1,i,i,node[0]);

        for(int i=1;i<=n;i++)
        {
            if(i==1)printf("%I64d",v[i]);
            else printf(" %I64d",v[i]);
        }
        printf("\n");
    }
	return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define maxn 100010
#define ll long long
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

ll orgin[maxn];
ll N,M,K;
struct Order
{
    ll l,r,d;
}o[maxn];
ll add1[maxn*6],add2[maxn*6];

void push_down2(ll rt)
{
    if(add2[rt])
    {
        add2[rt<<1]+=add2[rt];
        add2[rt<<1|1]+=add2[rt];
        add2[rt]=0;
    }
}
void update2(ll L,ll R,ll val,ll l,ll r,ll rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add2[rt]+=val;
        return;
    }
    push_down2(rt);
    ll mid=l+r>>1;
    update2(L,R,val,lson);
    update2(L,R,val,rson);
}
void query2(ll l,ll r,ll rt)
{
    ll i,j;
    if(l==r)
    {
        orgin[l]=orgin[l]+add2[rt];
        return;
    }
    ll mid=l+r>>1;
    push_down2(rt);
    query2(lson);
    query2(rson);
}

void push_down1(ll rt)
{
    if(add1[rt])
    {
        add1[rt<<1]+=add1[rt];
        add1[rt<<1|1]+=add1[rt];
        add1[rt]=0;
    }
}
void update1(ll L,ll R,ll val,ll l,ll r,ll rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add1[rt]+=val;
        return;
    }
    push_down1(rt);
    ll mid=l+r>>1;
    update1(L,R,val,lson);
    update1(L,R,val,rson);
}
void query1(ll l,ll r,ll rt)
{
    ll i,j;
    if(l==r)
    {
        update2(o[l].l,o[l].r,add1[rt]*o[l].d,1,N,1);
        return;
    }
    ll mid=l+r>>1;
    push_down1(rt);
    query1(lson);
    query1(rson);
}

int main()
{
    //freopen("input.txt","r",stdin);
    ll i,j;
    cin>>N>>M>>K;
    for(i=1;i<=N;i++)
    {
        cin>>orgin[i];
    }
    for(i=1;i<=M;i++)
    {
        cin>>o[i].l>>o[i].r>>o[i].d;
    }
    for(i=1;i<=K;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        update1(a,b,(ll)1,1,N,1);
    }
    query1(1,N,1);
    query2(1,N,1);

    for(i=1;i<=N;i++)
    {
        cout<<orgin[i];
        if(i==N)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1 | 1
#define LL long long
const int maxn = 101000;
struct seg
{
    LL sum[maxn << 2], add[maxn << 2];
    void PushUp(int rt)
    {
        sum[rt] = sum[rt << 1] + sum[rt << 1 | 1];
    }
    void PushDown(int rt, int m)
    {
        if (add[rt])
        {
            add[rt << 1] += add[rt];
            add[rt << 1 | 1] += add[rt];
            sum[rt << 1] += add[rt] * (m - (m >> 1));
            sum[rt << 1 | 1] += add[rt] * (m >> 1);
            add[rt] = 0;
        }
    }
    void build(int l, int r, int rt)
    {
        add[rt] = 0;
        if (l == r)
        {
            scanf("%I64d", &sum[rt]);
            return;
        }
        int m = (l + r) >> 1;
        build(lson);
        build(rson);
        PushUp(rt);
    }
    void update(int ll, int rr, LL c, int l, int r, int rt)
    {
        if (ll <= l && rr >= r)
        {
            sum[rt] += c * (r - l + 1);
            add[rt] += c;
            return;
        }
        PushDown(rt, r - l + 1);
        int m = (l + r) >> 1;
        if (ll <= m) update(ll, rr, c, lson);
        if (rr > m) update(ll, rr, c, rson);
        PushUp(rt);
    }
    LL query(int x, int l, int r, int rt)
    {
        if (l == r) return add[rt];
        PushDown(rt, r - l + 1);
        int m = (l + r) >> 1;
        if (x <= m) return query(x, lson);
        else return  query(x, rson);
    }
};
struct chg
{
    int l, r;
    LL d;
    void get()
    {
        scanf("%d%d%I64d", &l, &r, &d);
    }
} x[maxn];
seg a, b;
int main()
{
    int n, m, k;
    while (~scanf("%d%d%d", &n, &m, &k))
    {
        a.build(1, n, 1);
        memset(b.sum, 0, sizeof(b.sum));
        memset(b.add, 0, sizeof(b.add));
        for (int i = 1; i <= m; i++) x[i].get();
        for (int i = 1; i <= k; i++)
        {
            int l, r;
            scanf("%d%d", &l, &r);
            b.update(l, r, 1, 1, m, 1);
        }
        for (int i = 1; i <= m; i++)
        {
            LL tt = b.query(i, 1, m, 1);
            a.update(x[i].l, x[i].r, x[i].d * tt, 1, n, 1);
        }
        for (int i = 1; i <= n; i++)
        {
            LL ans = a.query(i, 1, n, 1);
            printf("%I64d ", ans);
        }
        printf("\n");
    }
    return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define maxn 100010
#define ll long long
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

ll orgin[maxn];
int N,M,K;
struct Order
{
    int l,r;
    ll d;
}o[maxn];
ll add1[maxn*5]={0},add2[maxn*5]={0};

void push_down2(int rt)
{
    if(add2[rt])
    {
        add2[rt<<1]+=add2[rt];
        add2[rt<<1|1]+=add2[rt];
        add2[rt]=0;
    }
}
void update2(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add2[rt]+=val;
        return;
    }
    push_down2(rt);
    int mid=l+r>>1;
    update2(L,R,val,lson);
    update2(L,R,val,rson);
}
void query2(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        orgin[l]=orgin[l]+add2[rt];
        return;
    }
    int mid=l+r>>1;
    push_down2(rt);
    query2(lson);
    query2(rson);
}

void push_down1(int rt)
{
    if(add1[rt])
    {
        add1[rt<<1]+=add1[rt];
        add1[rt<<1|1]+=add1[rt];
        add1[rt]=0;
    }
}
void update1(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add1[rt]+=val;
        return;
    }
    push_down1(rt);
    int mid=l+r>>1;
    update1(L,R,val,lson);
    update1(L,R,val,rson);
}
void query1(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        update2(o[l].l,o[l].r,add1[rt]*o[l].d,1,N,1);
        return;
    }
    int mid=l+r>>1;
    push_down1(rt);
    query1(lson);
    query1(rson);
}

int main()
{
   // freopen("input.txt","r",stdin);
    int i,j;
    cin>>N>>M>>K;
    for(i=1;i<=N;i++)
    {
        cin>>orgin[i];
    }
    for(i=1;i<=M;i++)
    {
        cin>>o[i].l>>o[i].r>>o[i].d;
    }
    for(i=1;i<=K;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        update1(a,b,(ll)1,1,N,1);
    }
    query1(1,N,1);
    query2(1,N,1);

    for(i=1;i<=N;i++)
    {
        cout<<orgin[i];
        if(i==N)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
    }
    return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define maxn 100010
#define ll long long
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

ll orgin[maxn];
int N,M,K;
struct Order
{
    int l,r;
    ll d;
}o[maxn];
ll add1[maxn*5],add2[maxn*5];

void push_down2(int rt)
{
    if(add2[rt])
    {
        add2[rt<<1]+=add2[rt];
        add2[rt<<1|1]+=add2[rt];
        add2[rt]=0;
    }
}
void update2(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add2[rt]+=val;
        return;
    }
    push_down2(rt);
    int mid=l+r>>1;
    update2(L,R,val,lson);
    update2(L,R,val,rson);
}
void query2(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        orgin[l]=orgin[l]+add2[rt];
        return;
    }
    int mid=l+r>>1;
    push_down2(rt);
    query2(lson);
    query2(rson);
}

void push_down1(int rt)
{
    if(add1[rt])
    {
        add1[rt<<1]+=add1[rt];
        add1[rt<<1|1]+=add1[rt];
        add1[rt]=0;
    }
}
void update1(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add1[rt]+=val;
        return;
    }
    push_down1(rt);
    int mid=l+r>>1;
    update1(L,R,val,lson);
    update1(L,R,val,rson);
}
void query1(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        update2(o[l].l,o[l].r,add1[rt]*o[l].d,1,N,1);
        return;
    }
    int mid=l+r>>1;
    push_down1(rt);
    query1(lson);
    query1(rson);
}

int main()
{
    //freopen("input.txt","r",stdin);
    int i,j;
    cin>>N>>M>>K;
    for(i=1;i<=N;i++)
    {
        cin>>orgin[i];
    }
    for(i=1;i<=M;i++)
    {
        cin>>o[i].l>>o[i].r>>o[i].d;
    }
    for(i=1;i<=K;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        update1(a,b,(ll)1,1,N,1);
    }
    query1(1,N,1);
    query2(1,N,1);

    for(i=1;i<=N;i++)
    {
        cout<<orgin[i];
        if(i==N)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
    }
    return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define maxn 100010
#define ll long long
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

ll orgin[maxn];
int N,M,K;
struct Order
{
    int l,r,d;
}o[maxn];
ll add1[maxn*6]={0},add2[maxn*6]={0};

void push_down2(int rt)
{
    if(add2[rt])
    {
        add2[rt<<1]+=add2[rt];
        add2[rt<<1|1]+=add2[rt];
        add2[rt]=0;
    }
}
void update2(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add2[rt]+=val;
        return;
    }
    push_down2(rt);
    int mid=l+r>>1;
    update2(L,R,val,lson);
    update2(L,R,val,rson);
}
void query2(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        orgin[l]=orgin[l]+add2[rt];
        return;
    }
    int mid=l+r>>1;
    push_down2(rt);
    query2(lson);
    query2(rson);
}

void push_down1(int rt)
{
    if(add1[rt])
    {
        add1[rt<<1]+=add1[rt];
        add1[rt<<1|1]+=add1[rt];
        add1[rt]=0;
    }
}
void update1(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add1[rt]+=val;
        return;
    }
    push_down1(rt);
    int mid=l+r>>1;
    update1(L,R,val,lson);
    update1(L,R,val,rson);
}
void query1(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        update2(o[l].l,o[l].r,add1[rt]*o[l].d,1,N,1);
        return;
    }
    int mid=l+r>>1;
    push_down1(rt);
    query1(lson);
    query1(rson);
}

int main()
{
   // freopen("input.txt","r",stdin);
    int i,j;
    cin>>N>>M>>K;
    for(i=1;i<=N;i++)
    {
        cin>>orgin[i];
    }
    for(i=1;i<=M;i++)
    {
        cin>>o[i].l>>o[i].r>>o[i].d;
    }
    for(i=1;i<=K;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        update1(a,b,(ll)1,1,N,1);
    }
    query1(1,N,1);
    query2(1,N,1);

    for(i=1;i<=N;i++)
    {
        cout<<orgin[i];
        if(i==N)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
    }
    return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define maxn 100010
#define ll long long
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

ll orgin[maxn];
ll N,M,K;
struct Order
{
    ll l,r,d;
}o[maxn];
ll add1[maxn*6],add2[maxn*6];

void push_down2(ll rt)
{
    if(add2[rt])
    {
        add2[rt<<1]+=add2[rt];
        add2[rt<<1|1]+=add2[rt];
        add2[rt]=0;
    }
}
void update2(ll L,ll R,ll val,ll l,ll r,ll rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add2[rt]+=val;
        return;
    }
    push_down2(rt);
    ll mid=l+r>>1;
    update2(L,R,val,lson);
    update2(L,R,val,rson);
}
void query2(ll l,ll r,ll rt)
{
    ll i,j;
    if(l==r)
    {
        orgin[l]=orgin[l]+add2[rt];
        return;
    }
    ll mid=l+r>>1;
    push_down2(rt);
    query2(lson);
    query2(rson);
}

void push_down1(ll rt)
{
    if(add1[rt])
    {
        add1[rt<<1]+=add1[rt];
        add1[rt<<1|1]+=add1[rt];
        add1[rt]=0;
    }
}
void update1(ll L,ll R,ll val,ll l,ll r,ll rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add1[rt]+=val;
        return;
    }
    push_down1(rt);
    ll mid=l+r>>1;
    update1(L,R,val,lson);
    update1(L,R,val,rson);
}
void query1(ll l,ll r,ll rt)
{
    ll i,j;
    if(l==r)
    {
        update2(o[l].l,o[l].r,add1[rt]*o[l].d,1,N,1);
        return;
    }
    ll mid=l+r>>1;
    push_down1(rt);
    query1(lson);
    query1(rson);
}

int main()
{
    //freopen("input.txt","r",stdin);
    ll i,j;
    cin>>N>>M>>K;
    for(i=1;i<=N;i++)
    {
        cin>>orgin[i];
    }
    for(i=1;i<=M;i++)
    {
        cin>>o[i].l>>o[i].r>>o[i].d;
    }
    for(i=1;i<=K;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        update1(a,b,(ll)1,1,N,1);
    }
    query1(1,N,1);
    query2(1,N,1);

    for(i=1;i<=N;i++)
    {
        printf("%I64d\n",orgin[i]);
        if(i==N)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
    }
    return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define maxn 100010
#define ll long long
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
using namespace std;

ll orgin[maxn];
int N,M,K;
struct Order
{
    int l,r;
    ll d;
}o[maxn];
ll add1[maxn*5],add2[maxn*5];

void push_down2(int rt)
{
    if(add2[rt])
    {
        add2[rt<<1]+=add2[rt];
        add2[rt<<1|1]+=add2[rt];
        add2[rt]=0;
    }
}
void update2(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add2[rt]+=val;
        return;
    }
    push_down2(rt);
    int mid=l+r>>1;
    update2(L,R,val,lson);
    update2(L,R,val,rson);
}
void query2(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        orgin[l]=orgin[l]+add2[rt];
        return;
    }
    int mid=l+r>>1;
    push_down2(rt);
    query2(lson);
    query2(rson);
}

void push_down1(int rt)
{
    if(add1[rt])
    {
        add1[rt<<1]+=add1[rt];
        add1[rt<<1|1]+=add1[rt];
        add1[rt]=0;
    }
}
void update1(int L,int R,ll val,int l,int r,int rt)
{
    if(r<L||R<l)
    {
        return;
    }
    if(L<=l&&r<=R)
    {
        add1[rt]+=val;
        return;
    }
    push_down1(rt);
    int mid=l+r>>1;
    update1(L,R,val,lson);
    update1(L,R,val,rson);
}
void query1(int l,int r,int rt)
{
    int i,j;
    if(l==r)
    {
        update2(o[l].l,o[l].r,add1[rt]*o[l].d,1,N,1);
        return;
    }
    int mid=l+r>>1;
    push_down1(rt);
    query1(lson);
    query1(rson);
}

int main()
{
    //freopen("input.txt","r",stdin);
    int i,j;
    cin>>N>>M>>K;
    for(i=1;i<=N;i++)
    {

        cin>>orgin[i];
    }
    for(i=1;i<=M;i++)
    {
        cin>>o[i].l>>o[i].r>>o[i].d;
    }
    for(i=1;i<=K;i++)
    {
        int a,b;
        scanf("%d %d",&a,&b);
        update1(a,b,1,1,N,1);
    }
    query1(1,N,1);

    query2(1,N,1);
    for(i=1;i<=N;i++)
    {
        cout<<orgin[i];
        if(i==N)
        {
            cout<<endl;
        }
        else
        {
            cout<<" ";
        }
    }
    return 0;
}


#include<cstring>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<iostream>
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1 | 1
#define LL long long
using namespace std;

const int maxn = 101000;
struct seg
{
    LL sum[maxn << 2], add[maxn << 2];
    void PushUp(int rt)
    {
        sum[rt] = sum[rt << 1] + sum[rt << 1 | 1];
    }
    void PushDown(int rt, int m)
    {
        if (add[rt])
        {
            add[rt << 1] += add[rt];
            add[rt << 1 | 1] += add[rt];
            sum[rt << 1] += add[rt] * (m - (m >> 1));
            sum[rt << 1 | 1] += add[rt] * (m >> 1);
            add[rt] = 0;
        }
    }
    void build(int l, int r, int rt)
    {
        add[rt] = 0;
        if (l == r)
        {
            cin>>add[rt];
            return;
        }
        int m = (l + r) >> 1;
        build(lson);
        build(rson);
        PushUp(rt);
    }
    void update(int ll, int rr, LL c, int l, int r, int rt)
    {
        if (ll <= l && rr >= r)
        {
            sum[rt] += c * (r - l + 1);
            add[rt] += c;
            return;
        }
        PushDown(rt, r - l + 1);
        int m = (l + r) >> 1;
        if (ll <= m) update(ll, rr, c, lson);
        if (rr > m) update(ll, rr, c, rson);
        PushUp(rt);
    }
    LL query(int x, int l, int r, int rt)
    {
        if (l == r) return add[rt];
        PushDown(rt, r - l + 1);
        int m = (l + r) >> 1;
        if (x <= m) return query(x, lson);
        else return  query(x, rson);
    }
};
struct chg
{
    int l, r;
    LL d;
    void get()
    {
        cin>>l>>r>>d;
    }
} x[maxn];
seg a, b;
int main()
{
    //freopen("input.txt","r",stdin);
    int n, m, k;
    while (~scanf("%d%d%d", &n, &m, &k))
    {
        a.build(1, n, 1);
        memset(b.sum, 0, sizeof(b.sum));
        memset(b.add, 0, sizeof(b.add));
        for (int i = 1; i <= m; i++) x[i].get();
        for (int i = 1; i <= k; i++)
        {
            int l, r;
            scanf("%d%d", &l, &r);
            b.update(l, r, 1, 1, m, 1);
        }
        for (int i = 1; i <= m; i++)
        {
            LL tt = b.query(i, 1, m, 1);
            a.update(x[i].l, x[i].r, x[i].d * tt, 1, n, 1);
        }
        for (int i = 1; i <= n; i++)
        {
            LL ans = a.query(i, 1, n, 1);
            cout<<ans<<" ";
        }
        printf("\n");
    }
    return 0;
}