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.
def to_list(s):
    return list(map(lambda x: int(x), s.split(' ')))

def perform_op(a,l,r,d,times):
    copy_a = a.copy()
    for i in range(l,r+1):
        copy_a[i] += d*times
    return copy_a

def get_dict(op_slices,m):
    lefts = []
    rights = []
    for i in range(len(op_slices)):
        lefts.append(op_slices[i][0])
        rights.append(op_slices[i][1])

    s_l = sorted(lefts)
    s_r = sorted(rights)

    dict_l = {}
    dict_r = {}
    dict_ = {}

    for i in range(1,3):
        dict_l[i], dict_r[i] = 0, len(s_r)

    l_idx = 0
    r_idx = 0
    l_counter = 0
    r_counter = len(s_r)

    for i in range(m):
        if l_idx < len(s_r):
            while (s_l[l_idx] <= i+1):
                l_counter += 1
                l_idx += 1
                if l_idx == len(s_r):
                    break
        if r_idx < len(s_r):
            while (s_r[r_idx] < i+1):
                r_idx += 1
                r_counter -= 1
                if r_idx == len(s_r):
                    break

        #print('r_counter=',r_counter,'i=',i)
        dict_l[i+1] = l_counter
        dict_r[i+1] = r_counter
        #print(dict_r)


    for i in range(1,m+1):
        dict_[i] = min(dict_l[i],dict_r[i])

    return dict_

n,m,k = to_list(input())
a = to_list(input())
ops = []
for i in range(m):
    ops.append(to_list(input()))


op_slices = []
for i in range(k):
    op_slice = to_list(input())
    op_slices.append(op_slice)
    
op_dict = get_dict(op_slices,m)


for op in op_dict:
    times = op_dict[op]
    l,r,d = ops[op-1]
    l -= 1
    r -= 1
    a = perform_op(a,l,r,d,times)
    
print(' '.join(list(map(lambda x: str(x),a))))