import java.util.*;;
class Main{
static int b[];
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
int n=in.nextInt();
int k=in.nextInt();
b=new int [1000000];
for(int i=1;i<=n;i) {
int c=in.nextInt();
f(i,i,c);
}
for(int i=0;i<k;i) {
int l=in.nextInt();
int r=in.nextInt();
int w=in.nextInt();
f(l,r,w);
}
for(int i=1;i<=n;i++) {
b[i]+=b[i-1];
System.out.print(b[i]+” “);
}
}
static void f(int l,int r,int c) {
b[l]+=c;
b[r+1]-=c;
}
}