import java.util.*; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); long[] arr = new long[n + 1]; for (int i = 0; i < n; i++) { arr[i + 1] = in.nextLong();
}
long[] preSum = new long[n + 1];
while (m-- > 0) {
int l = in.nextInt();
int r = in.nextInt();
int k = in.nextInt();
preSum[l] += k;
if (r < n)
preSum[r + 1] -= k;
}
for (int i = 0; i < n; i++) {
preSum[i + 1] = preSum[i] + preSum[i + 1];
}
for (int i = 0; i < n; i++) {
arr[i + 1] += preSum[i + 1];
System.out.print(arr[i + 1] + " ");
}
}
}