import java.util.Scanner;
public class Diff {
public static int []arr;
public static int []brr;
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m= sc.nextInt();
arr=new int[n+10];
brr=new int[n+10];
for(int i=1;i<=n;i){
arr[i]=sc.nextInt();
}
//构造差分数组
for(int i=1;i<=n;i){
insert(i,i,arr[i]);
}
for(int i=1;i<=m;i++){
int l= sc.nextInt();
int r= sc.nextInt();
int c= sc.nextInt();
insert(l,r,c);
}
//对差分数组做前缀和
for (int i=1;i<=n;i++){
brr[i]+=brr[i-1];
}
for (int i=1;i<=n;i++){
System.out.print(brr[i]+" ");
}
}
public static void insert(int l,int r,int c){
brr[l]+=c;
brr[r+1]-=c;
}
}