#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
  int A,B,m;
  cin >> A >> B >> m;
  int a[A],b[B];
  int mina=999999;
  int minb=999999;

  int xyc[m][3];

  for (int i = 0; i < A; i++)
  {
    cin >> a[i];
    if (a[i] < mina)
    {
      mina=a[i];
    }
  }
  
  for (int i = 0; i < B; i++)
  {
    cin >> b[i];
    if (b[i] < minb)
    {
      minb=b[i];
    }
  }

  for (int i = 0; i < m; i++)
  {
    for (int j = 0; j < 3; j++)
    {
      cin >> xyc[i][j];
    }
  }

  int minsum=mina+minb;
  
  // yes
  for (int i = 0; i < m; i++)
  {
    int sum = a[xyc[i][0]-1] + b[xyc[i][1]-1] - xyc[i][2];
    if (sum<minsum)
    {
      minsum=sum;
    } 
  }

  cout << minsum << "\n";

  return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1e9+7;
const ll INF = 1LL << 60;


int main() {
    int A, B, m; cin >> A >> B >> m;
    V<int> a(A), b(B);
    int amin = 1e9, bmin = 1e9;
    for(int i = 0; i < A; i++){
        cin >> a[i];
        amin = min(a[i], amin);
    }
    for(int i = 0; i < B; i++){
        cin >> b[i];
        bmin = min(b[i], bmin);
    }

    V<int> x(m), y(m), c(m);
    for(int i = 0; i < m; i++){
        int xx, yy, cc; cin >> xx >> yy >> cc;
        xx--, yy--;
        x[i] = xx;
        y[i] = yy;
        c[i] = cc;
    }

    int ans = 1e9;
    for(int i = 0; i < m; i++){
        ans = min(a[x[i]] + b[y[i]] - c[i], ans);
    }

    cout << min(ans, amin + bmin) << endl;

    return 0;
}
