#hitachi2020b. [hitachi2020_b]Nice Shopping

[hitachi2020_b]Nice Shopping

Problem Statement

You are visiting a large electronics store to buy a refrigerator and a microwave.

The store sells AA kinds of refrigerators and BB kinds of microwaves. The ii-th refrigerator ( 1leileA1 \\le i \\le A ) is sold at aia_i yen (the currency of Japan), and the jj-th microwave ( 1lejleB1 \\le j \\le B ) is sold at bjb_j yen.

You have MM discount tickets. With the ii-th ticket ( 1leileM1 \\le i \\le M ), you can get a discount of cic_i yen from the total price when buying the xix_i-th refrigerator and the yiy_i-th microwave together. Only one ticket can be used at a time.

You are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.

Constraints

  • All values in input are integers.
  • 1leAle1051 \\le A \\le 10^5
  • 1leBle1051 \\le B \\le 10^5
  • 1leMle1051 \\le M \\le 10^5
  • 1leai,bi,cile1051 \\le a_i , b_i , c_i \\le 10^5
  • 1lexileA1 \\le x_i \\le A
  • 1leyileB1 \\le y_i \\le B
  • cileaxi+byic_i \\le a_{x_i} + b_{y_i}

Input

Input is given from Standard Input in the following format:

AA BB MM a1a_1 a2a_2 ...... aAa_A b1b_1 b2b_2 ...... bBb_B x1x_1 y1y_1 c1c_1 vdots\\vdots xMx_M yMy_M cMc_M

Output

Print the answer.


Sample Input 1

2 3 1
3 3
3 3 3
1 2 1

Sample Output 1

5

With the ticket, you can get the 11-st refrigerator and the 22-nd microwave for 3+31=53+3-1=5 yen.


Sample Input 2

1 1 2
10
10
1 1 5
1 1 10

Sample Output 2

10

Note that you cannot use more than one ticket at a time.


Sample Input 3

2 2 1
3 5
3 5
2 2 2

Sample Output 3

6

You can get the 11-st refrigerator and the 11-st microwave for 66 yen, which is the minimum amount to pay in this case. Note that using a ticket is optional.