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.
from sys import stdin, stdout, setrecursionlimit
import threading

# tail-recursion optimization
# In case of tail-recusion optimized code, have to use python compiler.
# Otherwise, memory limit may exceed.
# declare the class Tail_Recursion_Optimization
class Tail_Recursion_Optimization:
    def __init__(self, RECURSION_LIMIT, STACK_SIZE):
        setrecursionlimit(RECURSION_LIMIT)
        threading.stack_size(STACK_SIZE)
        return None
    
class OPERATIONS:
    l = r = d = None
    
    def __init__(self, x, y, z):
        self.l = x
        self.r = y
        self.d = z
        
class SOLVE:
    n = m = k = None
    a = []
    operations = {}
    tree, tree_operations = {}, {}
    
    def update_operations(self, node, i, j, x, y):
        if node not in self.tree_operations:
            self.tree_operations[node] = 0
        
        if j < x or  y < i:
            return 0
        elif x <= i and j <= y:
            self.tree_operations[node] += 1
            return 0
        
        mid   = (i+j) // 2
        left  = 2*node
        right = 2*node + 1
        
        self.update_operations(left, i, mid, x, y) 
        self.update_operations(right, mid+1, j, x, y)
        return 0
    
    
    def query_operations(self, node, i, j, x, carry=0):
        if node not in self.tree_operations:
                self.tree_operations[node] = 0
                
        if  j < x or  x < i:
            return 0
        elif i == j:
            self.operations[x].d *= (carry + self.tree_operations[node])
            return 0
        
        mid   = (i+j) // 2
        left  = 2*node
        right = 2*node + 1
        
        self.query_operations(left, i, mid, x, carry + self.tree_operations[node])
        self.query_operations(right, mid+1, j, x, carry + self.tree_operations[node])
        return 0
    
    def update(self, node, i, j, x, y, add):
        if node not in self.tree:
            self.tree[node] = 0
        
        if j < x or  y < i:
            return 0
        elif x <= i and j <= y:
            self.tree[node] += add
            return 0
        
        mid   = (i+j) // 2
        left  = 2*node
        right = 2*node + 1
        
        self.update(left, i, mid, x, y, add) 
        self.update(right, mid+1, j, x, y, add)
        return 0
    
    def query(self, node, i, j, x, carry=0):
        if node not in self.tree:
            self.tree[node] = 0
                
        if  j < x or  x < i:
            return 0
        elif i == j:
            self.a[x] += carry + self.tree[node]
            return 0
        
        mid   = (i+j) // 2
        left  = 2*node
        right = 2*node + 1
        
        self.query(left, i, mid, x, carry + self.tree[node])
        self.query(right, mid+1, j, x, carry + self.tree[node])
        return 0
        
    
    def solve(self):
        R = stdin.readline
        #f = open('input.txt');R = f.readline
        W = stdout.write
        
        self.n, self.m, self.k = [int(x) for x in R().split()]
        self.a                 = [0] + [int(x) for x in R().split()]
        
        for i in range(1, self.m+1):
            x, y, z            = [int(X) for X in R().split()]
            self.operations[i] = OPERATIONS(x, y, z)
        
        for i in range(1, self.k+1):
            x, y = [int(X) for X in R().split()]
            self.update_operations(1, 1, self.m, x, y)
        
            
        for i in range(1, self.m+1):
            self.query_operations(1, 1, self.m, i) 
            
        for i in range(1, self.m+1):
            if self.operations[i].d:
                self.update(1, 1, self.n, self.operations[i].l, self.operations[i].r, self.operations[i].d)
               
        for i in range(1, self.n+1):
            self.query(1, 1, self.n, i)
            
        W(' '.join([str(self.a[i]) for i in range(1, self.n+1)]))
        return 0
        
def main():
    s = SOLVE()
    s.solve()
Tail_Recursion_Optimization(10**7, 100*1024**2) # recursion-call size, stack-size in byte (MB*1024**2)
threading.Thread(target=main).start()
#main()