import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); //存放数组元素 Long[] arr = new Long[n+1]; for(int i=0;i<n;i++){ arr[i+1]=sc.nextLong(); }

    long[] preSum=new long[n+1];
    //m次操作
    while(m-->0){
        int l=sc.nextInt();
        int r=sc.nextInt();
        int k=sc.nextInt();
        //进行差分处理
        preSum[l]+=k;
        if(r < n)

// if(r>=n) continue; preSum[r+1]-=k; }

    for(int i = 1;i <= n ;i ++){
        preSum[i] = preSum[i - 1] + preSum[i];
    }
    for(int i = 1;i <= n;i ++){
        arr[i] += preSum[i];
    }
    for(int i = 1;i <= n; i++){
        System.out.print(arr[i]+" ");
    }
}

}