It is the end of 2019 — the 17th of November, the Cooking Challenge day.
There are N$N$ players participating in this competition, numbered 1$1$ through N$N$. Initially, the skill level of each player is zero. There are also M$M$ challenges (numbered 1$1$ through M$M$). For each valid i$i$, the i$i$-th challenge has three parameters Li$L_i$, Ri$R_i$ and Xi$X_i$ with the following meaning: for each player between the Li$L_i$-th and Ri$R_i$-th inclusive, if this player participates in this challenge, their skill level increases by Xi$X_i$ (Xi$X_i$ does not have to be positive).
The organizers of the Cooking Challenge decided that the contest would be boring if they let the participants participate in the challenges directly, so they decided to use the compos.
There are Q$Q$ compos (numbered 1$1$ through Q$Q$). For each valid i$i$, the i$i$-th compo has two parameters Ai$A_i$ and Bi$B_i$, which means that it includes the challenges Ai,Ai+1,…,Bi$A_i, A_i+1, \ldots, B_i$.
Each participant has to select a subset of the compos (possibly empty or the set of all Q$Q$ compos) and participate in all challenges those compos include. A participant may not select the same compo twice, but may participate in the same challenge more than once if it is included in multiple chosen compos.
For each player, find the maximum skill level this player can reach if the compos are chosen optimally.

-----Input-----
- The first line of the input contains a single integer T$T$ denoting the number of test cases. The description of T$T$ test cases follows.
- The first line of each test case contains three space-separated integers N$N$, M$M$ and Q$Q$.
- M$M$ lines follow. For each valid i$i$, the i$i$-th of these lines contains three space-separated integers Li$L_i$, Ri$R_i$ and Xi$X_i$.
- Q$Q$ more lines follow. For each valid i$i$, the i$i$-th of these lines contains two space-separated integers Ai$A_i$ and Bi$B_i$.

-----Output-----
For each test case, print a single line containing N$N$ space-separated integers. For each valid i$i$, the i$i$-th of these integers should denote the maximum skill level of the i$i$-th player.

-----Constraints-----
- 1≤T≤1,000$1 \le T \le 1,000$
- 1≤N≤100,000$1 \le N \le 100,000$
- 1≤M≤1,000$1 \le M \le 1,000$
- 1≤Q≤10,000$1 \le Q \le 10,000$
- 1≤Li≤Ri≤N$1 \le L_i \le R_i \le N$ for each valid i$i$
- 1≤Ai≤Bi≤M$1 \le A_i \le B_i \le M$ for each valid i$i$
- |Xi|≤1,000,000$|X_i| \le 1,000,000$ for each valid i$i$
- the sum of N$N$ over all test cases does not exceed 1,000,000$1,000,000$
- the sum of M$M$ over all test cases does not exceed 5,000$5,000$
- the sum of Q$Q$ over all test cases does not exceed 50,000$50,000$

-----Example Input-----
1
5 3 4
1 1 3
1 2 -4
4 5 2
1 2
1 3
1 1
2 3

-----Example Output-----
3 0 0 4 4

-----Explanation-----
Example case 1:
- The first player will select the 3$3$-rd compo.
- The second and third players will not select any compo.
- The fourth player will select the 1$1$-st, 2$2$-nd and 4$4$-th compos.
- The fifth player will select all the compos.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = '# cook your dish here\nimport numpy as np\n\ndef sort_it(array):\n    new_list = []\n    for i in range(len(array)):\n        start = 0\n        value = array[i][0]\n        last = len(new_list)\n        while start != last:\n            mid = (start + last) // 2\n            if new_list[mid][0] > value:\n                last = mid\n            else:\n                start = mid+1\n        new_list.insert(start,array[i])\n    return new_list\n\ntests = int(input())\nfor _ in range(tests):\n    n, m, q = [int(j) for j in input().split()]\n    challenges = [[0] * 3 for _ in range(m)]\n    combos = [[0] * 2 for _ in range(q)]\n    for i in range(m):\n        challenges[i] = [int(j) for j in input().split()]\n    for i in range(q):\n        combos[i] = [int(j) for j in input().split()]\n    \n    sorted_chalenges = np.zeros((2 * m, 3),dtype=np.intc)\n    for i in range(m):\n        sorted_chalenges[2*i] = [challenges[i][0]-1,challenges[i][2],i]\n        sorted_chalenges[2*i+1] = [challenges[i][1],-challenges[i][2],i]\n    sorted_chalenges = np.array(sort_it(sorted_chalenges))\n    types_of_players = np.zeros((m + 1, 2 * m + 1),dtype=np.intc)\n    player_type = np.zeros(n,dtype=np.intc)\n    last_player = 0\n    for i in range(2 * m):\n        start, value, chal = sorted_chalenges[i]\n        types_of_players[chal+1:,i+1:] += value\n        player_type[last_player:start] = i\n        last_player = start\n    player_type[last_player:] = 2 * m\n    \n    combo_types = np.zeros((q, 2 * m + 1),dtype = np.intc)\n    for i in range(q):\n        first, last = combos[i]\n        r, p = [types_of_players[first - 1], types_of_players[last]]\n        combo_types[i] = np.maximum(p-r,0)\n    output = np.sum(combo_types,axis=0)[player_type]\n    for i in range(n):\n        print(output[i], end = " ")\n    print("")'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 6171250