Greg has an array *a* = *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> and *m* operations. Each operation looks as: *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>, *d*<sub class="lower-index">*i*</sub>, (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ *n*). To apply operation *i* to the array means to increase all array elements with numbers *l*<sub class="lower-index">*i*</sub>, *l*<sub class="lower-index">*i*</sub> + 1, ..., *r*<sub class="lower-index">*i*</sub> by value *d*<sub class="lower-index">*i*</sub>.

Greg wrote down *k* queries on a piece of paper. Each query has the following form: *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub>, (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ *y*<sub class="lower-index">*i*</sub> ≤ *m*). That means that one should apply operations with numbers *x*<sub class="lower-index">*i*</sub>, *x*<sub class="lower-index">*i*</sub> + 1, ..., *y*<sub class="lower-index">*i*</sub> to the array.

Now Greg is wondering, what the array *a* will be after all the queries are executed. Help Greg.
The first line contains integers *n*, *m*, *k* (1 ≤ *n*, *m*, *k* ≤ 10<sup class="upper-index">5</sup>). The second line contains *n* integers: *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (0 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>) — the initial array.

Next *m* lines contain operations, the operation number *i* is written as three integers: *l*<sub class="lower-index">*i*</sub>, *r*<sub class="lower-index">*i*</sub>, *d*<sub class="lower-index">*i*</sub>, (1 ≤ *l*<sub class="lower-index">*i*</sub> ≤ *r*<sub class="lower-index">*i*</sub> ≤ *n*), (0 ≤ *d*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">5</sup>).

Next *k* lines contain the queries, the query number *i* is written as two integers: *x*<sub class="lower-index">*i*</sub>, *y*<sub class="lower-index">*i*</sub>, (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ *y*<sub class="lower-index">*i*</sub> ≤ *m*).

The numbers in the lines are separated by single spaces.
import random, math
from copy import deepcopy as dc



# Function to call the actual solution
def solution(li, que, kque):
	out = [0]* len(li)
	quem = [0]*len(que)

	# Marking all the queries
	# which are to be performed
	for i in range(len(kque)):
		q = kque[i]
		quem[q[0]-1] += 1
		if q[1] != len(quem):
			quem[q[1]] -= 1

	# Making the prefix sum 
	for i in range(1, len(que)):
		quem[i] = quem[i] + quem[i-1]

	# Now Performing the queries
	for i in range(len(que)):
		q = que[i]
		out[q[0]-1] += q[2]*quem[i]
		# print(q[1])
		if q[1] != len(out):
			out[q[1]] -= q[2]*quem[i]

	# Making the prefix sum
	for i in range(1, len(out)):
		out[i] = out[i] + out[i-1]

	# Now adding the actual array
	for i in range(len(out)):
		out[i] += li[i]
	return out


# Function to take input
def input_test():
	n, m, k = map(int, input().strip().split(" "))
	li = list(map(int, input().strip().split(" ")))
	que = []
	
	for i in range(m):
		que.append(list(map(int, input().strip().split(" "))))
	kque = []
	for i in range(k):
		kque.append(list(map(int, input().strip().split(" "))))
	out = solution(li, que, kque)
	print(' '.join(list(map(str, out))))


# Function to check test my code
def test():
	pass


input_test()
# test()