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.math.BigInteger;
import java.util.*;

public class l {
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////                                                                                                               /////////
////////                                                                                                               /////////
////////   HHHH        HHHH  EEEEEEEEEEEEE   MMMM          MMMM         OOOOOO             SSSSSSS      EEEEEEEEEEEEE  /////////
////////   HHHH        HHHH  EEEEEEEEEEEEE   MMMMMM      MMMMMM      OOO      OOO        SSSS   SSS     EEEEEEEEEEEEE  /////////
////////   HHHH        HHHH  EEEEE           MMMM MMM  MMM MMMM    OOO          OOO    SSSS       SSS   EEEEE          /////////
////////   HHHH        HHHH  EEEEE           MMMM  MMMMMM  MMMM   OOO            OOO   SSSS             EEEEE          /////////
////////   HHHH        HHHH  EEEEE           MMMM          MMMM  OOO              OOO   SSSSSSS         EEEEE          /////////
////////   HHHHHHHHHHHHHHHH  EEEEEEEEEEE     MMMM          MMMM  OOO              OOO      SSSSSS       EEEEEEEEEEE    /////////
////////   HHHHHHHHHHHHHHHH  EEEEEEEEEEE     MMMM          MMMM  OOO              OOO         SSSSSSS   EEEEEEEEEEE    /////////
////////   HHHH        HHHH  EEEEE           MMMM          MMMM   OOO            OOO              SSSS  EEEEE          /////////
////////   HHHH        HHHH  EEEEE           MMMM          MMMM    OOO          OOO     SSS       SSSS  EEEEE          /////////
////////   HHHH        HHHH  EEEEEEEEEEEEE   MMMM          MMMM      OOO      OOO        SSS    SSSS    EEEEEEEEEEEEE  /////////
////////   HHHH        HHHH  EEEEEEEEEEEEE   MMMM          MMMM         OOOOOO             SSSSSSS      EEEEEEEEEEEEE  /////////
////////                                                                                                               /////////
////////                                                                                                               /////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    static long mod = (int) (1e9 + 7);
    static int n;
    static StringBuilder sol;

    static class pair implements Comparable<pair> {
        int a,b;

        public pair( int x,int y) {
            a=x;b=y;
        }


        public int compareTo(pair pair) {
            if (a!=pair.a)return a-pair.a;
            else return b-pair.b;
        }
        public String toString(){
            return a+" "+b;
        }
    }
    static boolean is;
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        //FileWriter f = new FileWriter("C:\\Users\\Ibrahim\\out.txt");
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int k = sc.nextInt();
        long[]a= new long[n];
        for (int i =0;i<n;i++){
            a[i]=sc.nextInt();
        }
        pair[]p = new pair[m];
        int[]val = new int[m];
        for (int i =0;i<m;i++){
            p[i]= new pair(sc.nextInt()-1,sc.nextInt());
            val[i]=sc.nextInt();
        }
        int[]ranges= new int[m];
        while (k-->0){
            int x =sc.nextInt()-1;
            int y = sc.nextInt();
            ranges[x]++;
            if (y<m)ranges[y]--;
        }
        for (int i =1;i<m;i++)ranges[i]+=ranges[i-1];
        long[]pref= new long[n];
        for (int i =0;i<m;i++){
            long x =1l*val[i]*ranges[i];
            pref[p[i].a]+=x;
            if (p[i].b<n)pref[p[i].b]-=x;
        }
        for (int i =1;i<n;i++)pref[i]+=pref[i-1];
        for (int i =0;i<n;i++)a[i]+=pref[i];
        for (long x:a)pw.print(x+" ");
        pw.flush();
    }
    static class Edge implements Comparable<Edge>
    {
        int node, cost;

        Edge(int a, int b) { node = a;	cost = b; }

        public int compareTo(Edge e){ return cost - e.cost;	}
    }
   static public class SegmentTree {        // 1-based DS, OOP

       int N;            //the number of elements in the array as a power of 2 (i.e. after padding)
       int[] array, sTree, lazy;

       SegmentTree(int[] in) {
           array = in;
           N = in.length - 1;
           sTree = new int[N << 1];        //no. of nodes = 2*N - 1, we add one to cross out index zero
           lazy = new int[N << 1];
           build(1, 1, N);
       }

       void build(int node, int b, int e)    // O(n)
       {
           if (b == e)
               sTree[node] = array[b];
           else {
               int mid = b + e >> 1;
               build(node << 1, b, mid);
               build(node << 1 | 1, mid + 1, e);
               sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
           }
       }


       void update_point(int index, int val)            // O(log n)
       {
           index += N - 1;
           sTree[index] += val;
           while (index > 1) {
               index >>= 1;
               sTree[index] = sTree[index << 1] + sTree[index << 1 | 1];
           }
       }


       void update_range(int i, int j, int val)        // O(log n)
       {
           update_range(1, 1, N, i, j, val);
       }

       void update_range(int node, int b, int e, int i, int j, int val) {
           if (i > e || j < b)
               return;
           if (b >= i && e <= j) {
               sTree[node] += (e - b + 1) * val;
               lazy[node] += val;
           } else {
               int mid = b + e >> 1;
               propagate(node, b, mid, e);
               update_range(node << 1, b, mid, i, j, val);
               update_range(node << 1 | 1, mid + 1, e, i, j, val);
               sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
           }

       }

       void propagate(int node, int b, int mid, int e) {
           lazy[node << 1] += lazy[node];
           lazy[node << 1 | 1] += lazy[node];
           sTree[node << 1] += (mid - b + 1) * lazy[node];
           sTree[node << 1 | 1] += (e - mid) * lazy[node];
           lazy[node] = 0;
       }

       int query(int i, int j) {
           return query(1, 1, N, i, j);
       }

       int query(int node, int b, int e, int i, int j)    // O(log n)
       {
           if (i > e || j < b)
               return 0;
           if (b >= i && e <= j)
               return sTree[node];
           int mid = b + e >> 1;
           propagate(node, b, mid, e);
           int q1 = query(node << 1, b, mid, i, j);
           int q2 = query(node << 1 | 1, mid + 1, e, i, j);
           return q1 + q2;

       }
   }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

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

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

        public double nextDouble() throws IOException {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if (x.charAt(0) == '-') {
                neg = true;
                start++;
            }
            for (int i = start; i < x.length(); i++)
                if (x.charAt(i) == '.') {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                } else {
                    sb.append(x.charAt(i));
                    if (dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg ? -1 : 1);
        }

        public boolean ready() throws IOException {
            return br.ready();
        }


    }
}