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 sys
import string
import math
import time
from collections import defaultdict
from functools import lru_cache
from collections import Counter
from fractions import Fraction

def mi(s):
    return map(int, s.strip().split())

def lmi(s):
    return list(mi(s))

def tmi(s):
    return tuple(mi(s))

def mf(f, s):
    return map(f, s)

def lmf(f, s):
    return list(mf(f, s))

def js(lst):
    return " ".join(str(d) for d in lst)

def jsns(lst):
    return "".join(str(d) for d in lst)

def line():
    return sys.stdin.readline().strip()

def linesp():
    return line().split()

def iline():
    return int(line())

def mat(n):
    matr = []
    for _ in range(n):
        matr.append(linesp())
    return matr

def matns(n):
    mat = []
    for _ in range(n):
        mat.append([c for c in line()])
    return mat

def mati(n):
    mat = []
    for _ in range(n):
       mat.append(lmi(line())) 
    return mat

def pmat(mat):
    for row in mat:
        print(js(row))

def main():
    n, m, k = mi(line())
    arr = lmi(line())
    ops = []
    for _ in range(m):
        x, y, d = lmi(line())
        ops.append((x - 1, y - 1, d))
    queries = []
    for _ in range(k):
        x, y = lmi(line())
        queries.append((x - 1, y - 1))

    sweep = []
    for x, y in queries:
        sweep.append((x, "add"))
        
        # Basically increment all windows by 1, so
        # that we don't have to care about annoying edge
        # cases for window size == 1.
        sweep.append((y + 1, "remove"))

    sweep.sort(key=lambda x: x[0])
    size = 0
    i = 0
    disjoint_queries = []
    prev_x = None
    while i < len(sweep):
        curr_x = sweep[i][0]
        j = i
        to_remove = 0
        prev_size = size
        while j < len(sweep):
            if sweep[j][0] != curr_x:
                break
            x, op = sweep[j]
            if op == "add":
                size += 1
            elif op == "remove":
                to_remove += 1
            j += 1
        i = j
        
        if prev_size > 0:
            # Don't care about size zero here.
            disjoint_queries.append((prev_x, curr_x, prev_size))
        prev_x = curr_x
        size -= to_remove

    new_ops = []
    for i in range(len(disjoint_queries)):
        l, r, size = disjoint_queries[i]
        if r - 1 >= l and size >= 1:
            for kk in range(l, r):
                x, y, d = ops[kk]
                new_ops.append((x, y, d * size))

    # Merge these intervals.
    sweep = []
    for x, y, d in new_ops:
        sweep.append((x, "add", d))
        
        # Basically increment all windows by 1, so
        # that we don't have to care about annoying edge
        # cases for window size == 1.
        sweep.append((y + 1, "remove", d))

    size = 0
    i = 0
    disjoint_ops = []
    prev_x = None
    while i < len(sweep):
        curr_x = sweep[i][0]
        j = i
        to_remove = 0
        prev_size = size
        while j < len(sweep):
            if sweep[j][0] != curr_x:
                break
            x, op, d = sweep[j]
            if op == "add":
                size += d
            elif op == "remove":
                to_remove += d
            j += 1
        i = j
        
        if prev_size > 0:
            # Don't care about size zero here.
            disjoint_ops.append((prev_x, curr_x, prev_size))
        prev_x = curr_x
        size -= to_remove

    for l, r, d in disjoint_ops:
        if r - 1 >= l:
            for kk in range(l, r):
                arr[kk] += d
    print(js(arr))

def main():
    n, m, k = mi(line())
    arr = lmi(line())
    ops = []
    for _ in range(m):
        x, y, d = lmi(line())
        ops.append((x - 1, y - 1, d))
    queries = []
    for _ in range(k):
        x, y = lmi(line())
        queries.append((x - 1, y - 1))

    op_counts = [0 for _ in range(len(ops) + 1)]
    for x, y in queries:
        op_counts[x] += 1
        op_counts[y + 1] -= 1

    curr = 0
    arr2 = [0 for _ in range(len(arr) + 1)]
    for i in range(len(op_counts) - 1):
        curr += op_counts[i]

        # Current que
        x, y, d = ops[i]
        arr2[x] += d * curr
        arr2[y + 1] -= d * curr

    curr = 0
    for i in range(len(arr2) - 1):
        curr += arr2[i]
        arr[i] += curr
    print(js(arr))
main()
