import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  int a, b, m;
  readf("%s %s %s\n", &a, &b, &m);
  auto as = readln.chomp.split.to!(int[]);
  auto bs = readln.chomp.split.to!(int[]);
  auto cost = as.reduce!(min) + bs.reduce!(min);

  foreach (_; 0..m) {
    int x, y, c;
    readf("%s %s %s\n", &x, &y, &c);
    cost = min(cost, as[x-1] + bs[y-1] - c);
  }
  cost.writeln;
}
