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

int main() {
  int A, B, M;
  cin >> A >> B >> M;
  vector<int> a(A);
  for (int i = 0; i < A; i++) cin >> a.at(i);
  vector<int> b(B);
  for (int i = 0; i < B; i++) cin >> b.at(i);

  int ans = *min_element(a.begin(), a.end()) + *min_element(b.begin(), b.end());
  
  for (int i = 0; i < M; i++) {
    int x, y, c;
    cin >> x >> y >> c;
    ans = min(ans, a.at(x - 1) + b.at(y - 1) - c);
  }

  cout << ans << "\n";
}
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    string str;
    int q;
    cin >> str >> q;

    for (int i = 0; i < q; i++) {
        string inst;
        unsigned int a,b;
        cin >> inst >> a >> b;

        if (inst == "print") {
            cout << str.substr(a,b-a+1) << endl;
        } else if (inst == "reverse") {
            string target = str.substr(a,b-a+1);
            reverse(target.begin(), target.end());
            str = str.substr(0,a) + target + str.substr(b+1);
        } else if (inst == "replace") {
            string rep;
            cin >> rep;
            str = str.substr(0,a) + rep + str.substr(b+1);
        }
    }
    return 0;
}