Greg has an array a = a1, a2, ..., an and m operations. Each operation looks as: li, ri, di, (1 ≤ li ≤ ri ≤ n). To apply operation i to the array means to increase all array elements with numbers li, li + 1, ..., ri by value di.

Greg wrote down k queries on a piece of paper. Each query has the following form: xi, yi, (1 ≤ xi ≤ yi ≤ m). That means that one should apply operations with numbers xi, xi + 1, ..., yi to the array.

Now Greg is wondering, what the array a will be after all the queries are executed. Help Greg.

Input

The first line contains integers n, m, k (1 ≤ n, m, k ≤ 105). The second line contains n integers: a1, a2, ..., an (0 ≤ ai ≤ 105) — the initial array.

Next m lines contain operations, the operation number i is written as three integers: li, ri, di, (1 ≤ li ≤ ri ≤ n), (0 ≤ di ≤ 105).

Next k lines contain the queries, the query number i is written as two integers: xi, yi, (1 ≤ xi ≤ yi ≤ m).

The numbers in the lines are separated by single spaces.

Output

On a single line print n integers a1, a2, ..., an — the array after executing all the queries. Separate the printed numbers by spaces.

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams of the %I64d specifier.

Examples

Input

3 3 3
1 2 3
1 2 1
1 3 2
2 3 4
1 2
1 3
2 3


Output

9 18 17


Input

1 1 1
1
1 1 1
1 1


Output

2


Input

4 3 6
1 2 3 4
1 2 1
2 3 2
3 4 4
1 2
1 3
2 3
1 2
1 3
2 3


Output

5 18 31 20
import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class A {
    static class Pair<FIRST, SECOND> implements Comparable<Pair<FIRST, SECOND>> {

        public final FIRST first;
        public final SECOND second;

        private Pair(FIRST first, SECOND second) {
            this.first = first;
            this.second = second;
        }

        public static <FIRST, SECOND> Pair<FIRST, SECOND> of(FIRST first,
                                                             SECOND second) {
            return new Pair<FIRST, SECOND>(first, second);
        }

        @Override
        public int compareTo(Pair<FIRST, SECOND> o) {
            int cmp = compare(first, o.first);
            return cmp == 0 ? compare(second, o.second) : cmp;
        }

        // todo move this to a helper class.
        private static int compare(Object o1, Object o2) {
            return o1 == null ? o2 == null ? 0 : -1 : o2 == null ? +1
                    : ((Comparable) o1).compareTo(o2);
        }

        @Override
        public int hashCode() {
            return 31 * hashcode(first) + hashcode(second);
        }

        // todo move this to a helper class.
        private static int hashcode(Object o) {
            return o == null ? 0 : o.hashCode();
        }

        @Override
        public boolean equals(Object obj) {
            if (!(obj instanceof Pair))
                return false;
            if (this == obj)
                return true;
            return equal(first, ((Pair) obj).first)
                    && equal(second, ((Pair) obj).second);
        }

        // todo move this to a helper class.
        private boolean equal(Object o1, Object o2) {
            return o1 == null ? o2 == null : (o1 == o2 || o1.equals(o2));
        }

        @Override
        public String toString() {
            return "(" + first + ", " + second + ')';
        }
    }

    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
        public MyScanner(String filename) throws IOException {
            br = new BufferedReader(new FileReader(filename));
        }

        public MyScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(this.next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(this.next());
        }

        String nextLine() throws IOException {
            String r = br.readLine();
            st = null;
            return r;
        }

        char nextCharacter() throws IOException {
            return this.next().charAt(0);
        }
    }

    public static void main(String[] args) throws IOException {
        new A().solve();
    }

    public void solve() throws IOException {
        MyScanner in = new MyScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt(), m = in.nextInt(), k = in.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        int[] l = new int[m];
        int[] r = new int[m];
        long[] d = new long[m];
        for (int i = 0; i < m; i++) {
            l[i] = in.nextInt() - 1;
            r[i] = in.nextInt();
            d[i] = in.nextInt();
        }
        int[] x = new int[k];
        int[] y = new int[k];
        for (int i = 0; i < k; i++) {
            x[i] = in.nextInt() - 1;
            y[i] = in.nextInt();
        }

        long[] ops = new long[m + 1];
        for (int i = 0; i < k; i++) {
            ops[y[i]]++;
            ops[x[i]]--;
        }
        long[] counts = new long[m + 1];
        long cur = 0;
        for (int i = m; i >= 0; i--) {
            counts[i] = cur;
            cur += ops[i];
        }
//        for (long i: counts) {
//            System.err.printf("%d ", i);
//        }
//        System.err.println();
        for (int i = 0; i < m; i++) {
            d[i] *= counts[i];
        }
        long[] ops2 = new long[n + 1];
        for (int i = 0; i < m; i++) {
            ops2[r[i]] += d[i];
            ops2[l[i]] -= d[i];
        }
        long[] counts2 = new long[n + 1];
        cur = 0;
        for (int i = n; i >= 0; i--) {
            counts2[i] = cur;
            cur += ops2[i];
        }
        for (int i = 0; i < n; i++) {
            out.print((a[i] + counts2[i]) + " ");
        }
        out.close();
    }
}
