#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define _for(i,a,b) for(int i = (a);i < b;i ++)
#define _rep(i,a,b) for(int i = (a);i > b;i --)
#define INF 0x3f3f3f3f
#define ZHUO 11100000007
#define MOD 1000000007
#define MIKUNUM 39
#define pb push_back
#define debug() printf("Miku Check OK!\n")
#define X first
#define Y second
#define maxn 200039

int n, m, p;
ll rnt = -INF;
struct good
{
	int val;
	int w;
	bool operator < (good b)
	{
		if(val!=b.val)
			return val < b.val;
		return w < b.w;
	}
	bool operator == (good b)
	{
		return val == b.val;
	}
}a[maxn], b[maxn];
struct mons
{
	int x;
	int y;
	int w;
	bool operator < (mons b)
	{
		return x < b.x;
	}
}mo[maxn];

struct disp
{
	int sz;
	good bcopy[maxn];
	int lsh[maxn];
	int bvalcopy[maxn];
	void init()
	{
        memcpy(bcopy,b,sizeof(b));
        _for(i,1,m+1)
        	bvalcopy[i] = b[i].val;
		sort(bcopy+1,bcopy+1+m);
		sort(bvalcopy,bvalcopy+1+m);
		unique(bvalcopy+1,bvalcopy+1+m);
		sz = unique(bcopy+1,bcopy+1+m)-(bcopy+1);
		_for(i,1,n+1)
			lsh[i] = lower_bound(bvalcopy+1,bvalcopy+1+sz,b[i].val)-bvalcopy;
	}
	int getsmall(int x)
	{
		return lower_bound(bvalcopy+1,bvalcopy+1+sz,x)-bvalcopy;
	}
	int getbigval(int i)
	{
		return bcopy[lsh[i]].val;
	}
	int getbigw(int i)
	{
		return bcopy[i].w;
	}
}dsp;

struct SegTree
{
	struct SegNode
	{
		int l,r;
		ll add;
		ll max;
		#define l(x) tree[x].l
		#define r(x) tree[x].r
		#define add(x) tree[x].add
		#define MAX(x) tree[x].max
	}tree[maxn<<2];
	void build(int p,int l,int r)
	{
		l(p) = l,r(p) = r;
		if(l==r)
		{
			MAX(p) = -dsp.getbigw(r);
			return ;
		}
		int mid = (l+r)/2;
		build(p*2, l, mid);
		build(p*2+1, mid+1, r);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	void spread(int p)
	{
		if(add(p))
		{
			MAX(p*2) += add(p);
			MAX(p*2+1) += add(p);
			add(p*2) += add(p);
			add(p*2+1) += add(p);
			add(p) = 0;
		}
	}
	void change(int p,int l,int r,ll d)
	{
		if(l <= l(p) && r >= r(p))
		{
			MAX(p) += d;
			add(p) += d;
			return ;
		}
		spread(p);
		int mid = (l(p)+r(p))/2;
		if(l <= mid)
			change(p*2, l, r, d);
		if(r > mid)
			change(p*2+1, l, r, d);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	ll ask4max(int p,int l,int r)
	{
		if(l <= l(p) && r >= r(p))
			return MAX(p);
		spread(p);
		int mid = (l(p)+r(p))/2;
		ll val = -INF;
		if(l <= mid)
			val = max(val,ask4max(p*2, l, r));
		if(r > mid)
			val = max(val,ask4max(p*2+1, l, r));
		return val;
	}
}T;

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m >> p;
	_for(i,1,n+1)
		cin >> a[i].val >> a[i].w;
	_for(i,1,m+1)
		cin >> b[i].val >> b[i].w;
	_for(i,1,p+1)
		cin >> mo[i].x >> mo[i].y >> mo[i].w;

	sort(mo+1,mo+1+p);
	sort(a+1,a+1+n);
	dsp.init();
	T.build(1,1,dsp.sz);

	int in = 1;
	_for(i,1,n+1)
	{
		while(in <= p && mo[in].x < a[i].val)
		{
			int x = upper_bound(dsp.bvalcopy+1,dsp.bvalcopy+1+dsp.sz,mo[in].y)-dsp.bvalcopy;
			T.change(1,x,dsp.sz,mo[in].w);
			in ++;
		}
		rnt = max(rnt,T.ask4max(1,1,dsp.sz)-a[i].w);
	}
	printf("%lld",rnt);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define _for(i,a,b) for(int i = (a);i < b;i ++)
#define _rep(i,a,b) for(int i = (a);i > b;i --)
#define INF 0x3f3f3f3f3f3f3f3f
#define ZHUO 11100000007
#define MOD 1000000007
#define MIKUNUM 39
#define pb push_back
#define debug() printf("Miku Check OK!\n")
#define X first
#define Y second
#define maxn 200039

int n, m, p;
ll rnt = -INF;
struct good
{
	ll val;
	ll w;
	bool operator < (good b)
	{
		if(val!=b.val)
			return val < b.val;
		return w < b.w;
	}
}a[maxn], b[maxn];
struct mons
{
	ll x;
	ll y;
	ll w;
	bool operator < (mons b)
	{
		return x < b.x;
	}
}mo[maxn];

int t;
struct piece
{
	ll bw[maxn];
	//MAX[i]��ʾ�� i �ε�ԭʼ���
	//add[i]��ʾ�� i �ε�ÿ��Ԫ�ش���ֵ /�������
	ll MAX[maxn], add[maxn];
	//L[i]��R[i]��ʾ�� i ����ԭ�����е����Ҷ˵��±�
	int L[maxn], R[maxn];
	//pos[j]��ʾ ԭ�����±� j ����һ��
	int pos[maxn];

	void init()
	{
		t = sqrt(m);
		_for(i,1,t+3)
			MAX[i] = -INF;
		_for(i,1,t+1)
		{
			L[i] = (i-1) * sqrt(m) + 1;
			R[i] = i * sqrt(m);
		}

		if(R[t] < m)
		{
			t ++;
			L[t] = R[t-1] + 1;
			R[t] = m;
		}

		_for(i,1,t+1)
		_for(j,L[i],R[i]+1)
		{
			pos[j] = i, MAX[i] = max(MAX[i],bw[j]);
		//	if(i==2)
		//		cout << MAX[i] << endl;
		}
	}
	void change(int l, int r, ll d)
	{
		int p = pos[l], q = pos[r];

		if(p==q)
		{
			_for(i,l,r+1)
				bw[i] += d;
			_for(i,L[p],R[p]+1)
				MAX[p] = max(MAX[p],bw[i]);
		}
		else
		{
			_for(i,p+1,q)
				add[i] += d;

			_for(i,l,R[p]+1)
				bw[i] += d;
			_for(i,L[p],R[p]+1)
				MAX[p] = max(MAX[p],bw[i]);

			_for(i,L[q],r+1)
				bw[i] += d;
			_for(i,L[q],R[q]+1)
				MAX[q] = max(MAX[q],bw[i]);
		}
	}

	ll ask(int l,int r)
	{
		int p = pos[l], q = pos[r];
		ll ans = -INF;

		if(p==q)
		{
			_for(i,l,r+1)
				ans = max(ans,bw[i]);
			ans += add[p];
		}
		else
		{
			_for(i,p+1,q)
				ans = max(ans,MAX[i]+add[i]);
			_for(i,l,R[p]+1)
				ans = max(ans,bw[i]);
			ans += add[p];

			_for(i,L[q],r+1)
				ans = max(ans,bw[i]);
			ans += add[q];
		}
		return ans;
	}
} P;

ll bval[maxn];
int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m >> p;
	_for(i,1,n+1)
		cin >> a[i].val >> a[i].w;
	_for(i,1,m+1)
		cin >> b[i].val >> b[i].w;
	_for(i,1,p+1)
		cin >> mo[i].x >> mo[i].y >> mo[i].w;

	sort(a+1,a+1+n);
	sort(b+1,b+1+m);
	sort(mo+1,mo+1+p);

	_for(i,1,m+1)
		bval[i] = b[i].val,P.bw[i] = -b[i].w;
	P.init();

	int in = 1;
	ll rnt = -INF;
	_for(i,1,n+1)
	{
		while(in <= p && mo[in].x < a[i].val)
		{
			int x = upper_bound(bval+1,bval+1+m,mo[in].y)-bval;
			if(x<=m)
				P.change(x, m, mo[in].w);
			in ++;
		}
		rnt = max(rnt,P.ask(1,m)-a[i].w);
	}
	printf("%lld",rnt);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define _for(i,a,b) for(int i = (a);i < b;i ++)
#define _rep(i,a,b) for(int i = (a);i > b;i --)
#define INF 0x3f3f3f3f
#define ZHUO 11100000007
#define MOD 1000000007
#define MIKUNUM 39
#define pb push_back
#define debug() printf("Miku Check OK!\n")
#define X first
#define Y second
#define maxn 200039

int n, m, p;
ll rnt = -INF;
struct good
{
	int val;
	int w;
	bool operator < (good b)
	{
		if(val!=b.val)
			return val < b.val;
		return w < b.w;
	}
	bool operator == (good b)
	{
		return val == b.val;
	}
}a[maxn], b[maxn];
struct mons
{
	int x;
	int y;
	int w;
	bool operator < (mons b)
	{
		return x < b.x;
	}
}mo[maxn];

struct disp
{
	int sz;
	good bcopy[maxn];
	int lsh[maxn];
	int bvalcopy[maxn];
	void init()
	{
        memcpy(bcopy,b,sizeof(b));
        _for(i,1,m+1)
        	bvalcopy[i] = b[i].val;
		sort(bcopy+1,bcopy+1+m);
		sort(bvalcopy,bvalcopy+1+m);
		unique(bvalcopy+1,bvalcopy+1+m);
		sz = unique(bcopy+1,bcopy+1+m)-(bcopy+1);
		_for(i,1,n+1)
			lsh[i] = lower_bound(bvalcopy+1,bvalcopy+1+sz,b[i].val)-bvalcopy;
	}
	int getsmall(int x)
	{
		return lower_bound(bvalcopy+1,bvalcopy+1+sz,x)-bvalcopy;
	}
	int getbigval(int i)
	{
		return bcopy[lsh[i]].val;
	}
	int getbigw(int i)
	{
		return bcopy[i].w;
	}
}dsp;

struct SegTree
{
	struct SegNode
	{
		int l,r;
		ll add;
		ll max;
		#define l(x) tree[x].l
		#define r(x) tree[x].r
		#define add(x) tree[x].add
		#define MAX(x) tree[x].max
	}tree[maxn<<2];
	void build(int p,int l,int r)
	{
		l(p) = l,r(p) = r;
		if(l==r)
		{
			MAX(p) = -dsp.getbigw(r);
			return ;
		}
		int mid = (l+r)/2;
		build(p*2, l, mid);
		build(p*2+1, mid+1, r);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	void spread(int p)
	{
		if(add(p))
		{
			MAX(p*2) += add(p);
			MAX(p*2+1) += add(p);
			add(p*2) += add(p);
			add(p*2+1) += add(p);
			add(p) = 0;
		}
	}
	void change(int p,int l,int r,ll d)
	{
		if(l <= l(p) && r >= r(p))
		{
			MAX(p) += d;
			add(p) += d;
			return ;
		}
		spread(p);
		int mid = (l(p)+r(p))/2;
		if(l <= mid)
			change(p*2, l, r, d);
		if(r > mid)
			change(p*2+1, l, r, d);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	ll ask4max(int p,int l,int r)
	{
		if(l <= l(p) && r >= r(p))
			return MAX(p);
		spread(p);
		int mid = (l(p)+r(p))/2;
		ll val = -INF;
		if(l <= mid)
			val = max(val,ask4max(p*2, l, r));
		if(r > mid)
			val = max(val,ask4max(p*2+1, l, r));
		return val;
	}
}T;

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m >> p;
	_for(i,1,n+1)
		cin >> a[i].val >> a[i].w;
	_for(i,1,m+1)
		cin >> b[i].val >> b[i].w;
	_for(i,1,p+1)
		cin >> mo[i].x >> mo[i].y >> mo[i].w;

	sort(mo+1,mo+1+p);
	dsp.init();
	T.build(1,1,dsp.sz);

	int in = 1;
	_for(i,1,n+1)
	{
		while(in <= p && mo[in].x < a[i].val)
		{
			int x = upper_bound(dsp.bvalcopy+1,dsp.bvalcopy+1+dsp.sz,mo[in].y)-dsp.bvalcopy;
			T.change(1,x,dsp.sz,mo[i].w);
			in ++;
		}
		rnt = max(rnt,T.ask4max(1,1,dsp.sz)-a[i].w);
	}
	printf("%lld\n",rnt);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define _for(i,a,b) for(int i = (a);i < b;i ++)
#define _rep(i,a,b) for(int i = (a);i > b;i --)
#define INF 0x3f3f3f3f
#define ZHUO 11100000007
#define MOD 1000000007
#define MIKUNUM 39
#define pb push_back
#define debug() printf("Miku Check OK!\n")
#define X first
#define Y second
#define maxn 200039

int n, m, p;
ll rnt = -INF;
struct good
{
	int val;
	int w;
	bool operator < (good b)
	{
		if(val!=b.val)
			return val < b.val;
		return w < b.w;
	}
	bool operator == (good b)
	{
		return val == b.val;
	}
}a[maxn], b[maxn];
struct mons
{
	int x;
	int y;
	int w;
	bool operator < (mons b)
	{
		return x < b.x;
	}
}mo[maxn];

struct disp
{
	int sz;
	good bcopy[maxn];
	int bvalcopy[maxn];
	void init()
	{
        memcpy(bcopy,b,sizeof(b));
        _for(i,1,m+1)
        	bvalcopy[i] = b[i].val;
		sort(bcopy+1,bcopy+1+m);
		sort(bvalcopy+1,bvalcopy+1+m);
		unique(bvalcopy+1,bvalcopy+1+m);
		sz = unique(bcopy+1,bcopy+1+m)-(bcopy+1);
	}
	int getbigw(int i)
	{
		return bcopy[i].w;
	}
}dsp;

struct SegTree
{
	struct SegNode
	{
		int l,r;
		ll add;
		ll max;
		#define l(x) tree[x].l
		#define r(x) tree[x].r
		#define add(x) tree[x].add
		#define MAX(x) tree[x].max
	}tree[maxn<<2];
	void build(int p,int l,int r)
	{
		l(p) = l,r(p) = r;
		if(l==r)
		{
			MAX(p) = -dsp.getbigw(r);
			return ;
		}
		int mid = (l+r)/2;
		build(p*2, l, mid);
		build(p*2+1, mid+1, r);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	void spread(int p)
	{
		if(add(p))
		{
			MAX(p*2) += add(p);
			MAX(p*2+1) += add(p);
			add(p*2) += add(p);
			add(p*2+1) += add(p);
			add(p) = 0;
		}
	}
	void change(int p,int l,int r,ll d)
	{
		if(l <= l(p) && r >= r(p))
		{
			MAX(p) += d;
			add(p) += d;
			return ;
		}
		spread(p);
		int mid = (l(p)+r(p))/2;
		if(l <= mid)
			change(p*2, l, r, d);
		if(r > mid)
			change(p*2+1, l, r, d);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	ll ask4max(int p,int l,int r)
	{
		if(l <= l(p) && r >= r(p))
			return MAX(p);
		spread(p);
		int mid = (l(p)+r(p))/2;
		ll val = -INF;
		if(l <= mid)
			val = max(val,ask4max(p*2, l, r));
		if(r > mid)
			val = max(val,ask4max(p*2+1, l, r));
		return val;
	}
}T;

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m >> p;
	_for(i,1,n+1)
		cin >> a[i].val >> a[i].w;
	_for(i,1,m+1)
		cin >> b[i].val >> b[i].w;
	_for(i,1,p+1)
		cin >> mo[i].x >> mo[i].y >> mo[i].w;

	sort(mo+1,mo+1+p);
	sort(a+1,a+1+n);
	dsp.init();
	T.build(1,1,dsp.sz);

	int in = 1;
	_for(i,1,n+1)
	{
		while(in <= p && mo[in].x < a[i].val)
		{
			int x = upper_bound(dsp.bvalcopy+1,dsp.bvalcopy+1+dsp.sz,mo[in].y)-dsp.bvalcopy;
			T.change(1,x,dsp.sz,mo[in].w);
			in ++;
		}
		rnt = max(rnt,T.ask4max(1,1,dsp.sz)-a[i].w);
	}
	printf("%lld",rnt);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define _for(i,a,b) for(int i = (a);i < b;i ++)
#define _rep(i,a,b) for(int i = (a);i > b;i --)
#define INF 0x3f3f3f3f
#define ZHUO 11100000007
#define MOD 1000000007
#define MIKUNUM 39
#define pb push_back
#define debug() printf("Miku Check OK!\n")
#define X first
#define Y second
#define maxn 200039

int n, m, p;
ll rnt = -INF;
struct good
{
	int val;
	int w;
	bool operator < (good b)
	{
		if(val!=b.val)
			return val < b.val;
		return w < b.w;
	}
	bool operator == (good b)
	{
		return val == b.val;
	}
}a[maxn], b[maxn];
struct mons
{
	int x;
	int y;
	int w;
	bool operator < (mons b)
	{
		return x < b.x;
	}
}mo[maxn];

struct disp
{
	int sz;
	good bcopy[maxn];
	int lsh[maxn];
	int bvalcopy[maxn];
	void init()
	{
        memcpy(bcopy,b,sizeof(b));
        _for(i,1,m+1)
        	bvalcopy[i] = b[i].val;
		sort(bcopy+1,bcopy+1+m);
		sort(bvalcopy,bvalcopy+1+m);
		unique(bvalcopy+1,bvalcopy+1+m);
		sz = unique(bcopy+1,bcopy+1+m)-(bcopy+1);
		_for(i,1,n+1)
			lsh[i] = lower_bound(bvalcopy+1,bvalcopy+1+sz,b[i].val)-bvalcopy;
	}
	int getsmall(int x)
	{
		return lower_bound(bvalcopy+1,bvalcopy+1+sz,x)-bvalcopy;
	}
	int getbigval(int i)
	{
		return bcopy[lsh[i]].val;
	}
	int getbigw(int i)
	{
		return bcopy[i].w;
	}
}dsp;

struct SegTree
{
	struct SegNode
	{
		int l,r;
		ll add;
		ll max;
		#define l(x) tree[x].l
		#define r(x) tree[x].r
		#define add(x) tree[x].add
		#define MAX(x) tree[x].max
	}tree[maxn<<2];
	void build(int p,int l,int r)
	{
		l(p) = l,r(p) = r;
		if(l==r)
		{
			MAX(p) = -dsp.getbigw(r);
			return ;
		}
		int mid = (l+r)/2;
		build(p*2, l, mid);
		build(p*2+1, mid+1, r);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	void spread(int p)
	{
		if(add(p))
		{
			MAX(p*2) += add(p);
			MAX(p*2+1) += add(p);
			add(p*2) += add(p);
			add(p*2+1) += add(p);
			add(p) = 0;
		}
	}
	void change(int p,int l,int r,ll d)
	{
		if(l <= l(p) && r >= r(p))
		{
			MAX(p) += d;
			add(p) += d;
			return ;
		}
		spread(p);
		int mid = (l(p)+r(p))/2;
		if(l <= mid)
			change(p*2, l, r, d);
		if(r > mid)
			change(p*2+1, l, r, d);
		MAX(p) = max(MAX(p*2),MAX(p*2+1));
	}
	ll ask4max(int p,int l,int r)
	{
		if(l <= l(p) && r >= r(p))
			return MAX(p);
		spread(p);
		int mid = (l(p)+r(p))/2;
		ll val = -INF;
		if(l <= mid)
			val = max(val,ask4max(p*2, l, r));
		if(r > mid)
			val = max(val,ask4max(p*2+1, l, r));
		return val;
	}
}T;

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> m >> p;
	_for(i,1,n+1)
		cin >> a[i].val >> a[i].w;
	_for(i,1,m+1)
		cin >> b[i].val >> b[i].w;
	_for(i,1,p+1)
		cin >> mo[i].x >> mo[i].y >> mo[i].w;

	sort(mo+1,mo+1+p);
	dsp.init();
	T.build(1,1,dsp.sz);

	int in = 1;
	_for(i,1,n+1)
	{
		while(in <= p && mo[in].x < a[i].val)
		{
			int x = upper_bound(dsp.bvalcopy+1,dsp.bvalcopy+1+dsp.sz,mo[in].y)-dsp.bvalcopy;
			T.change(1,x,dsp.sz,mo[in].w);
			in ++;
		}
		rnt = max(rnt,T.ask4max(1,1,dsp.sz)-a[i].w);
	}
	printf("%lld\n",rnt);
	return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <chrono>
#include <random>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define ls x<<1
#define rs x<<1|1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define fun function
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define int long long

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 1e18;
const int N=1e6+10;

struct node {
	int l,r,mid,ma,lazy;
} tree[N<<2];

struct wuqi {
	int a,b;
	bool operator <(const wuqi &x)const {
		return a<x.a;
	}
} a[N];

struct fangju {
	int a,b;
	bool operator <(const fangju &x)const {
		return a<x.a;
	}
} b[N];

struct guaiwu {
	int a,b,c;
	bool operator <(const guaiwu &x)const {
		return a<x.a;
	}
} c[N];

int d[N];

void pp(int x) {
	tree[x].ma=max(tree[ls].ma,tree[rs].ma);
}

void pd(int x) {
	if(tree[x].lazy) {
		tree[ls].lazy+=tree[x].lazy;
		tree[rs].lazy+=tree[x].lazy;
		tree[ls].ma+=tree[x].lazy;
		tree[rs].ma+=tree[x].lazy;
		tree[x].lazy=0;
	}
}

void build(int x,int l,int r) {
	tree[x]= {l,r,l+r>>1,0,0};
	if(l==r) {
		tree[x].ma=-b[l].b;
		return ;
	}
	int mid=tree[x].mid;
	build(ls,l,mid);
	build(rs,mid+1,r);
	pp(x);
}

void change(int x,int l,int r,int k) {
	if(l<=tree[x].l&&tree[x].r<=r) {
		tree[x].lazy+=k;
		tree[x].ma+=k;
		return;
	}
	pd(x);
	int mid=tree[x].mid;
	if(l<=mid)
		change(ls,l,r,k);
	if(r>mid)
		change(rs,l,r,k);
	pp(x);
}

signed main() {
	IOS;
#ifdef xiaofan
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif

	int n,m,p;
	cin>>n>>m>>p;
	for(int i=1; i<=n; i++) cin>>a[i].a>>a[i].b;
	for(int i=1; i<=m; i++) cin>>b[i].a>>b[i].b;
	for(int i=1; i<=p; i++) cin>>c[i].a>>c[i].b>>c[i].c;
	sort(a+1,a+1+n);
	sort(b+1,b+1+m);
	sort(c+1,c+1+p);
	for(int i=1; i<=m; i++) d[i]=b[i].a;
	build(1,1,m);
	int ans=-INF;
	for(int i=1,pos=1; i<=n; i++) {
		while(pos<=p && c[pos].a<a[i].a) {
			int w=upper_bound(d+1,d+1+m,c[pos].b)-d;
			if(w<=m)
				change(1,w,m,c[pos].c);
			pos++;
		}
		ans=max(ans,tree[1].ma-a[i].b);
	}
	cout<<ans<<endl;

	return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <chrono>
#include <random>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define ls x<<1
#define rs x<<1|1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define fun function
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define int long long

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 1e18;
const int N=1e6+10;

struct node {
	int l,r,mid,ma,lazy;
} tree[N<<2];

struct wuqi {
	int a,b;
	bool operator <(const wuqi &x)const {
		return a<x.a;
	}
} a[N];

struct fangju {
	int a,b;
	bool operator <(const fangju &x)const {
		return a<x.a;
	}
} b[N];

struct guaiwu {
	int a,b,c;
	bool operator <(const guaiwu &x)const {
		return a<x.a;
	}
} c[N];

int d[N];

void pp(int x) {
	tree[x].ma=max(tree[ls].ma,tree[rs].ma);
}

void pd(int x) {
	if(tree[x].lazy) {
		tree[ls].lazy+=tree[x].lazy;
		tree[rs].lazy+=tree[x].lazy;
		tree[ls].ma+=tree[x].lazy;
		tree[rs].ma+=tree[x].lazy;
		tree[x].lazy=0;
	}
}

void build(int x,int l,int r) {
	tree[x]= {l,r,l+r>>1,0,0};
	if(l==r) {
		tree[x].ma=-b[l].b;
		return ;
	}
	int mid=tree[x].mid;
	build(ls,l,mid);
	build(rs,mid+1,r);
	pp(x);
}

void change(int x,int l,int r,int k) {
	if(l<=tree[x].l&&tree[x].r<=r) {
		tree[x].lazy+=k;
		tree[x].ma+=k;
		return;
	}
	pd(x);
	int mid=tree[x].mid;
	if(l<=mid)
		change(ls,l,r,k);
	if(r>mid)
		change(rs,l,r,k);
	pp(x);
}

signed main() {
	IOS;
#ifdef xiaofan
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif

	int n,m,p;
	cin>>n>>m>>p;
	for(int i=1; i<=n; i++) cin>>a[i].a>>a[i].b;
	for(int i=1; i<=m; i++) cin>>b[i].a>>b[i].b;
	for(int i=1; i<=p; i++) cin>>c[i].a>>c[i].b>>c[i].c;
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	sort(c+1,c+1+n);
	for(int i=1; i<=m; i++) d[i]=b[i].a;
	build(1,1,m);
	int ans=-INF;
	for(int i=1,pos=0; i<=n; i++) {
		while(pos<p && c[pos+1].a<a[i].a) {
			pos++;
			int w=upper_bound(d+1,d+1+m,c[pos].b)-d;
			if(w<=m)
				change(1,w,m,c[pos].c);
		}
		ans=max(ans,tree[1].ma-a[i].b);
		if(n==666)
			cout<<ans<<" "<<tree[1].ma<<" "<<a[i].a<<" "<<pos<<" "<<" "<<c[pos].a<<" "<<c[531].a<<endl;
	}
	cout<<ans<<endl;

	return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <chrono>
#include <random>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define ls x<<1
#define rs x<<1|1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define fun function
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define int long long

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 1e18;
const int N=1e6+10;

struct node {
	int l,r,mid,ma,lazy;
} tree[N<<2];

struct wuqi {
	int a,b;
	bool operator <(const wuqi &x)const {
		return a<x.a;
	}
} a[N];

struct fangju {
	int a,b;
	bool operator <(const fangju &x)const {
		return a<x.a;
	}
} b[N];

struct guaiwu {
	int a,b,c;
	bool operator <(const guaiwu &x)const {
		return a<x.a;
	}
} c[N];

int d[N];

void pp(int x) {
	tree[x].ma=max(tree[ls].ma,tree[rs].ma);
}

void pd(int x) {
	if(tree[x].lazy) {
		tree[ls].lazy+=tree[x].lazy;
		tree[rs].lazy+=tree[x].lazy;
		tree[ls].ma+=tree[x].lazy;
		tree[rs].ma+=tree[x].lazy;
		tree[x].lazy=0;
	}
}

void build(int x,int l,int r) {
	tree[x]= {l,r,l+r>>1,0,0};
	if(l==r) {
		tree[x].ma=-b[l].b;
		return ;
	}
	int mid=tree[x].mid;
	build(ls,l,mid);
	build(rs,mid+1,r);
	pp(x);
}

void change(int x,int l,int r,int k) {
	if(l<=tree[x].l&&tree[x].r<=r) {
		tree[x].lazy+=k;
		tree[x].ma+=k;
		return;
	}
	pd(x);
	int mid=tree[x].mid;
	if(l<=mid)
		change(ls,l,r,k);
	if(r>mid)
		change(rs,l,r,k);
	pp(x);
}

signed main() {
	IOS;
#ifdef xiaofan
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif

	int n,m,p;
	cin>>n>>m>>p;
	for(int i=1; i<=n; i++) cin>>a[i].a>>a[i].b;
	for(int i=1; i<=m; i++) cin>>b[i].a>>b[i].b;
	for(int i=1; i<=p; i++) cin>>c[i].a>>c[i].b>>c[i].c;
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	sort(c+1,c+1+n);
	for(int i=1; i<=m; i++) d[i]=b[i].a;
	build(1,1,m);
	int ans=-INF;
	for(int i=1,pos=0; i<=n; i++) {
		while(pos<p && c[pos+1].a<a[i].a) {
			pos++;
			int w=upper_bound(d+1,d+1+m,c[pos].b)-d;
			if(w<=m)
				change(1,w,m,c[pos].c);
		}
		ans=max(ans,tree[1].ma-a[i].b);
		if(n==666)
			cout<<ans<<" "<<tree[1].ma<<" "<<a[i].a<<" "<<pos<<" "<<c[531].a<<endl;
	}
	cout<<ans<<endl;

	return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const int N = 2e5 + 5;
const int INF = 0x7fffffff;
int n, m, p;

struct node
{
    int a, c;
    node(int x = 0)
    {
        a = x, c = 0;
    }
} wp[N], ar[N];
bool operator<(node a, node b)
{
    return a.a < b.a;
}
struct node2
{
    int x, y, z;
} mon[N];

bool operator<(node2 a, node2 b)
{
    return a.x < b.x;
}

int ans = -INF;
int mx[N << 2], tag[N << 2];

inline void add(int k, int v)
{
    mx[k] += v;
    tag[k] += v;
}
inline void pushup(int k)
{
    mx[k] = max(mx[k << 1], mx[k << 1 | 1]);
}
inline void pushdwn(int k)
{
    add(k << 1, tag[k]);
    add(k << 1 | 1, tag[k]);
    tag[k] = 0;
}
void build(int k, int l, int r)
{
    if (l == r)
    {
        mx[k] = -ar[l].c;
        return;
    }
    int mid = l + r >> 1;
    build(k << 1, l, mid);
    build(k << 1 | 1, mid + 1, r);
    pushup(k);
    return;
}

void modify(int k, int l, int r, int qx, int qy, int qv)
{
    if (qx <= l && r <= qy)
        return add(k, qv);
    pushdwn(k);
    int mid = l + r >> 1;
    if (qx <= mid)
        modify(k << 1, l, mid, qx, qy, qv);
    if (mid < qy)
        modify(k << 1 | 1, mid + 1, r, qx, qy, qv);
    pushup(k);
    return;
}

int main()
{
    sddd(n, m, p);
    rep(i, 1, n)
        sdd(wp[i].a, wp[i].c);
    rep(i, 1, m)
        sdd(ar[i].a, ar[i].c);
    sort(wp + 1, wp + n + 1);
    sort(ar + 1, ar + m + 1);
    rep(i, 1, p)
        sddd(mon[i].x, mon[i].y, mon[i].z);
    sort(mon + 1, mon + p + 1);
    build(1, 1, m);
    for (int i = 1, s1 = 0; i <= n; i++)
    {
        while (s1 < p && mon[s1 + 1].x < wp[i].a)
        {
            s1++;
            int w = upper_bound(ar + 1, ar + m + 1, node(mon[s1].y)) - ar;
            if (w <= m)
                modify(1, 1, m, w, m, mon[s1].z);
        }
        ans = max(ans, mx[1] - wp[i].c);
       if(n==666)
        	cout<<ans<<" "<<mx[1]<<" "<<wp[i].a<<" "<<s1<<" "<<mon[s1].x<<" "<<mon[530].x<<endl;
    }
    pd(ans);
    return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <chrono>
#include <random>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define ls x<<1
#define rs x<<1|1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define fun function
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define int long long

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 1e18;
const int N=1e6+10;

struct node {
	int l,r,mid,ma,lazy;
} tree[N<<2];

struct wuqi {
	int a,b;
	bool operator <(const wuqi &x)const {
		return a<x.a;
	}
} a[N];

struct fangju {
	int a,b;
	bool operator <(const fangju &x)const {
		return a<x.a;
	}
} b[N];

struct guaiwu {
	int a,b,c;
	bool operator <(const guaiwu &x)const {
		return a<x.a;
	}
} c[N];

int d[N];

void pp(int x) {
	tree[x].ma=max(tree[ls].ma,tree[rs].ma);
}

void pd(int x) {
	if(tree[x].lazy) {
		tree[ls].lazy+=tree[x].lazy;
		tree[rs].lazy+=tree[x].lazy;
		tree[ls].ma+=tree[x].lazy;
		tree[rs].ma+=tree[x].lazy;
		tree[x].lazy=0;
	}
}

void build(int x,int l,int r) {
	tree[x]= {l,r,l+r>>1,0,0};
	if(l==r) {
		tree[x].ma=-b[l].b;
		return ;
	}
	int mid=tree[x].mid;
	build(ls,l,mid);
	build(rs,mid+1,r);
	pp(x);
}

void change(int x,int l,int r,int k) {
	if(l<=tree[x].l&&tree[x].r<=r) {
		tree[x].lazy+=k;
		tree[x].ma+=k;
		return;
	}
	pd(x);
	int mid=tree[x].mid;
	if(l<=mid)
		change(ls,l,r,k);
	if(r>mid)
		change(rs,l,r,k);
	pp(x);
}

signed main() {
	IOS;
#ifdef xiaofan
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif

	int n,m,p;
	cin>>n>>m>>p;
	for(int i=1; i<=n; i++) cin>>a[i].a>>a[i].b;
	for(int i=1; i<=m; i++) cin>>b[i].a>>b[i].b;
	for(int i=1; i<=p; i++) cin>>c[i].a>>c[i].b>>c[i].c;
	sort(a+1,a+1+n);
	sort(b+1,b+1+m);
	sort(c+1,c+1+p);
	for(int i=1; i<=m; i++) d[i]=b[i].a;
	build(1,1,m);
	int ans=-INF;
	for(int i=1,pos=0; i<=n; i++) {
		while(pos<=p && c[pos].a<a[i].a) {

			int w=upper_bound(d+1,d+1+m,c[pos].b)-d;
			if(w<=m)
				change(1,w,m,c[pos].c);
			pos++;
		}
		ans=max(ans,tree[1].ma-a[i].b);
	}
	cout<<ans<<endl;

	return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdio>
#include <chrono>
#include <random>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <set>
#if __cplusplus >= 201103L
#include <unordered_map>
#include <unordered_set>
#endif
#define ls x<<1
#define rs x<<1|1
#define fi first
#define se second
#define ll long long
#define pb push_back
#define mp make_pair
#define fun function
#define lowbit(x) x&(-x)
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
#define int long long

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int INF = 1e18;
const int N=1e6+10;

struct node {
	int l,r,mid,ma,lazy;
} tree[N<<2];

struct wuqi {
	int a,b;
	bool operator <(const wuqi &x)const {
		return a<x.a;
	}
} a[N];

struct fangju {
	int a,b;
	bool operator <(const fangju &x)const {
		return a<x.a;
	}
} b[N];

struct guaiwu {
	int a,b,c;
	bool operator <(const guaiwu &x)const {
		return a<x.a;
	}
} c[N];

int d[N];

void pp(int x) {
	tree[x].ma=max(tree[ls].ma,tree[rs].ma);
}

void pd(int x) {
	if(tree[x].lazy) {
		tree[ls].lazy+=tree[x].lazy;
		tree[rs].lazy+=tree[x].lazy;
		tree[ls].ma+=tree[x].lazy;
		tree[rs].ma+=tree[x].lazy;
		tree[x].lazy=0;
	}
}

void build(int x,int l,int r) {
	tree[x]= {l,r,l+r>>1,0,0};
	if(l==r) {
		tree[x].ma=-b[l].b;
		return ;
	}
	int mid=tree[x].mid;
	build(ls,l,mid);
	build(rs,mid+1,r);
	pp(x);
}

void change(int x,int l,int r,int k) {
	if(l<=tree[x].l&&tree[x].r<=r) {
		tree[x].lazy+=k;
		tree[x].ma+=k;
		return;
	}
	pd(x);
	int mid=tree[x].mid;
	if(l<=mid)
		change(ls,l,r,k);
	if(r>mid)
		change(rs,l,r,k);
	pp(x);
}

signed main() {
	IOS;
#ifdef xiaofan
	freopen("1.in","r",stdin);
	freopen("1.out","w",stdout);
#endif

	int n,m,p;
	cin>>n>>m>>p;
	for(int i=1; i<=n; i++) cin>>a[i].a>>a[i].b;
	for(int i=1; i<=m; i++) cin>>b[i].a>>b[i].b;
	for(int i=1; i<=p; i++) cin>>c[i].a>>c[i].b>>c[i].c;
	sort(a+1,a+1+n);
	sort(b+1,b+1+n);
	sort(c+1,c+1+n);
	for(int i=1; i<=m; i++) d[i]=b[i].a;
	build(1,1,m);
	int ans=-INF;
	for(int i=1,pos=0; i<=n; i++) {
		while(pos<p && c[pos+1].a<a[i].a) {
			pos++;
			int w=upper_bound(d+1,d+1+m,c[pos].b)-d;
			if(w<=m)
				change(1,w,m,c[pos].c);
		}
		ans=max(ans,tree[1].ma-a[i].b);
		/*if(n==666)
			cout<<ans<<" "<<tree[1].ma<<" "<<a[i].a<<" "<<pos<<endl;*/
	}
	cout<<ans<<endl;

	return 0;
}


#include <cstdio>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
using namespace std;
#define sd(n) scanf("%d", &n)
#define sdd(n, m) scanf("%d%d", &n, &m)
#define sddd(n, m, k) scanf("%d%d%d", &n, &m, &k)
#define pd(n) printf("%d\n", n)
#define pc(n) printf("%c", n)
#define pdd(n, m) printf("%d %d\n", n, m)
#define pld(n) printf("%lld\n", n)
#define pldd(n, m) printf("%lld %lld\n", n, m)
#define sld(n) scanf("%lld", &n)
#define sldd(n, m) scanf("%lld%lld", &n, &m)
#define slddd(n, m, k) scanf("%lld%lld%lld", &n, &m, &k)
#define sf(n) scanf("%lf", &n)
#define sc(n) scanf("%c", &n)
#define sff(n, m) scanf("%lf%lf", &n, &m)
#define sfff(n, m, k) scanf("%lf%lf%lf", &n, &m, &k)
#define ss(str) scanf("%s", str)
#define rep(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = n; i >= a; i--)
#define mem(a, n) memset(a, n, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define mod(x) ((x) % MOD)
#define gcd(a, b) __gcd(a, b)
#define lowbit(x) (x & -x)
typedef pair<int, int> PII;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const int N = 2e5 + 5;
const int INF = 0x7fffffff;
int n, m, p;

struct node
{
    int a, c;
    node(int x = 0)
    {
        a = x, c = 0;
    }
} wp[N], ar[N];
bool operator<(node a, node b)
{
    return a.a < b.a;
}
struct node2
{
    int x, y, z;
} mon[N];

bool operator<(node2 a, node2 b)
{
    return a.x < b.x;
}

int ans = -INF;
int mx[N << 2], tag[N << 2];

inline void add(int k, int v)
{
    mx[k] += v;
    tag[k] += v;
}
inline void pushup(int k)
{
    mx[k] = max(mx[k << 1], mx[k << 1 | 1]);
}
inline void pushdwn(int k)
{
    add(k << 1, tag[k]);
    add(k << 1 | 1, tag[k]);
    tag[k] = 0;
}
void build(int k, int l, int r)
{
    if (l == r)
    {
        mx[k] = -ar[l].c;
        return;
    }
    int mid = l + r >> 1;
    build(k << 1, l, mid);
    build(k << 1 | 1, mid + 1, r);
    pushup(k);
    return;
}

void modify(int k, int l, int r, int qx, int qy, int qv)
{
    if (qx <= l && r <= qy)
        return add(k, qv);
    pushdwn(k);
    int mid = l + r >> 1;
    if (qx <= mid)
        modify(k << 1, l, mid, qx, qy, qv);
    if (mid < qy)
        modify(k << 1 | 1, mid + 1, r, qx, qy, qv);
    pushup(k);
    return;
}

int main()
{
    sddd(n, m, p);
    rep(i, 1, n)
        sdd(wp[i].a, wp[i].c);
    rep(i, 1, m)
        sdd(ar[i].a, ar[i].c);
    sort(wp + 1, wp + n + 1);
    sort(ar + 1, ar + m + 1);
    rep(i, 1, p)
        sddd(mon[i].x, mon[i].y, mon[i].z);
    sort(mon + 1, mon + p + 1);
    build(1, 1, m);
    for (int i = 1, s1 = 0; i <= n; i++)
    {
        while (s1 < p && mon[s1 + 1].x < wp[i].a)
        {
            s1++;
            int w = upper_bound(ar + 1, ar + m + 1, node(mon[s1].y)) - ar;
            if (w <= m)
                modify(1, 1, m, w, m, mon[s1].z);
        }
        ans = max(ans, mx[1] - wp[i].c);
       if(n==666)
        	cout<<ans<<" "<<mx[1]<<" "<<wp[i].a<<" "<<s1<<" "<<mon[s1].a<<" "<<mon[530].a<<endl;
    }
    pd(ans);
    return 0;
}


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

typedef long long int ll;
typedef unsigned long long int ull;
ll power(ll x,ll y,ll p){ll r=1; x=x%p; while(y>0){ if(y&1) r= r*x%p; y=y>>1; x=x*x%p; } return r; }

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int csrand(int l=0, int r=1e9){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}

#define PR(x) cout<<#x<<" : "<<x<<"\n";
#define PR1(x,y) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"\n";
#define PR2(x,y,z) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"  |  "<<#z<<" : "<<z<<"\n";
#define ED cout<<'\n';

#define IO              ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FILEIO          freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define all(v)          v.begin(),v.end()
#define endl            '\n'
#define fr1(j,n)        for(int j=0;j<n;j++)
#define fr(n)           for(int i=0;i<n;i++)
#define PB              push_back
#define pii             pair<int,int>
#define pll             pair<long long int,long long int>
#define F               first
#define S               second

const ll mod=1e9+7;
const ll mod9=998244353;
const int N=1e6+99;

ll stree[(N+5)<<4],lazy[(N+5)<<4];

void push(int nd,int l,int r)
{
    if(lazy[nd]==0)
        return ;
    stree[nd]+=lazy[nd];
    if(l!=r)
    {
        lazy[nd+nd] += lazy[nd];
        lazy[nd+nd+1] += lazy[nd];
    }
    lazy[nd]=0;
}
void update(int nd,int l,int r,int i,int j,ll val)
{
    push(nd,l,r);
    if(r<i || l>j || l>r) return ;
    if(i<=l && r<=j)
    {
        lazy[nd]+=val;
        push(nd,l,r);
        return;
    }
    int lt= nd<<1 , rt=lt|1 , mi=(l+r)/2;
    update(lt,l,mi,i,j,val);
    update(rt,1+mi,r,i,j,val);
    stree[nd]=max(stree[lt],stree[rt]);
}

ll query(int nd,int l,int r,int i,int j)
{
    if(r<i || l>j || l>r)
        return -1e17;
    push(nd,l,r);
    if(i<=l && r<=j)
        return stree[nd];
    int lt= nd<<1 , rt=lt|1 , mi=(l+r)/2;

    return max( query(lt,l,mi,i,j) , query(rt,1+mi,r,i,j));
}

struct st{
    int t,x,y,z;
};
bool comp(st a,st b)
{
    if(a.x!=b.x)
        return a.x<b.x;
    else if(a.t!=b.t)
        return a.t<b.t;
    else
        return a.y<b.y;
}

int main()
{
    IO
    #ifndef ONLINE_JUDGE
    FILEIO
    #endif

    int n,m,p;
    cin>>n>>m>>p;

    vector<pii> ww(n),aa(m),www,aaa;

    fr(n) cin>>ww[i].F>>ww[i].S;
    fr(m) cin>>aa[i].F>>aa[i].S;

    sort(all(ww));
    sort(all(aa));

    for(auto x:ww)
    {
        while(!www.empty() && www.back().S>=x.S) www.pop_back();

        if(www.empty())
            www.PB(x);
        else if(www.back().F!=x.F)
            www.PB(x);

    }

    for(auto x:aa)
    {
        while(!aaa.empty() && aaa.back().S>=x.S) aaa.pop_back();

        if(aaa.empty())
            aaa.PB(x);
        else if(aaa.back().F!=x.F)
            aaa.PB(x);

    }
    aa.clear();ww.clear();
    aa=www;
    ww=aaa;
    n=ww.size();
    m=aa.size();

    vector<st> fv;

    for(auto x:aa)
    {
        st tmp;
        tmp.t=0;
        tmp.x=x.F;
        tmp.z=-x.S;
        fv.PB(tmp);
    }

    fr(p)
    {
        st tmp;
        tmp.t=1;
        cin>>tmp.x>>tmp.y>>tmp.z;
        fv.PB(tmp);
    }

    sort(all(fv),comp);

    int pr=0;
    for(auto x:ww)
    {
        update(1,0,N,pr,x.F-1,-x.S);
        pr=x.F;
    }
    update(1,0,N,pr,N,-1e17);

    // for(int i=0;i<12;i++)
    //     cout<<query(1,0,N,i,i)<<" ";ED

    ll ans=-1e17;

    for(auto x:fv)
    {
        if(x.t==0)
        {
            ll tt=stree[1];
           // PR1(tt,x.z)

            ans=max(ans,tt+x.z);
        }
        else
        {
            //PR1(x.y,x.z)
            update(1,0,N,x.y,N,x.z);

            // for(int i=0;i<12;i++)
            //     cout<<query(1,0,N,i,i)<<" ";ED
        }
    }

    cout<<ans<<endl;

}


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

typedef long long int ll;
typedef unsigned long long int ull;
ll power(ll x,ll y,ll p){ll r=1; x=x%p; while(y>0){ if(y&1) r= r*x%p; y=y>>1; x=x*x%p; } return r; }

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int csrand(int l=0, int r=1e9){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}

#define PR(x) cout<<#x<<" : "<<x<<"\n";
#define PR1(x,y) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"\n";
#define PR2(x,y,z) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"  |  "<<#z<<" : "<<z<<"\n";
#define ED cout<<'\n';

#define IO              ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FILEIO          freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define all(v)          v.begin(),v.end()
#define endl            '\n'
#define fr1(j,n)        for(int j=0;j<n;j++)
#define fr(n)           for(int i=0;i<n;i++)
#define PB              push_back
#define pii             pair<int,int>
#define pll             pair<long long int,long long int>
#define F               first
#define S               second

const ll mod=1e9+7;
const ll mod9=998244353;
const int N=1e6+99;

ll stree[(N+5)<<4],lazy[(N+5)<<4];

void push(int nd,int l,int r)
{
    if(lazy[nd]==0)
        return ;
    stree[nd]+=lazy[nd];
    if(l!=r)
    {
        lazy[nd+nd] += lazy[nd];
        lazy[nd+nd+1] += lazy[nd];
    }
    lazy[nd]=0;
}
void update(int nd,int l,int r,int i,int j,ll val)
{
    push(nd,l,r);
    if(r<i || l>j || l>r) return ;
    if(i<=l && r<=j)
    {
        lazy[nd]+=val;
        push(nd,l,r);
        return;
    }
    int lt= nd<<1 , rt=lt|1 , mi=(l+r)/2;
    update(lt,l,mi,i,j,val);
    update(rt,1+mi,r,i,j,val);
    stree[nd]=max(stree[lt],stree[rt]);
}

ll query(int nd,int l,int r,int i,int j)
{
    if(r<i || l>j || l>r)
        return -1e17;
    push(nd,l,r);
    if(i<=l && r<=j)
        return stree[nd];
    int lt= nd<<1 , rt=lt|1 , mi=(l+r)/2;

    return max( query(lt,l,mi,i,j) , query(rt,1+mi,r,i,j));
}

struct st{
    int t,x,y,z;
};
bool comp(st a,st b)
{
    if(a.x!=b.x)
        return a.x<b.x;
    else if(a.t!=b.t)
        return a.t<b.t;
    else
        return a.y<b.y;
}

int main()
{
    IO
    #ifndef ONLINE_JUDGE
    FILEIO
    #endif

    int n,m,p;
    cin>>n>>m>>p;

    vector<pii> ww(n),aa(m),www,aaa;

    fr(n) cin>>ww[i].F>>ww[i].S;
    fr(m) cin>>aa[i].F>>aa[i].S;

    sort(all(ww));
    sort(all(aa));

    for(auto x:ww)
    {
        while(!www.empty() && www.back().S>=x.S) www.pop_back();

        if(www.empty())
            www.PB(x);
        else if(www.back().F!=x.F)
            www.PB(x);

    }

    for(auto x:aa)
    {
        while(!aaa.empty() && aaa.back().S>=x.S) aaa.pop_back();

        if(aaa.empty())
            aaa.PB(x);
        else if(aaa.back().F!=x.F)
            aaa.PB(x);

    }
    aa.clear();ww.clear();
    aa=www;
    ww=aaa;
    n=ww.size();
    m=aa.size();

    vector<st> fv;

    for(auto x:aa)
    {
        st tmp;
        tmp.t=0;
        tmp.x=x.F;
        tmp.z=-x.S;
        fv.PB(tmp);
    }

    fr(p)
    {
        st tmp;
        tmp.t=1;
        cin>>tmp.x>>tmp.y>>tmp.z;
        fv.PB(tmp);
    }

    sort(all(fv),comp);

    int pr=0;
    for(auto x:ww)
    {
        update(1,0,N,pr,x.F-1,-x.S);
        pr=x.F;
    }
    update(1,0,N,pr,N,-1e17);

    // for(int i=0;i<12;i++)
    //     cout<<query(1,0,N,i,i)<<" ";ED

    ll ans=0;

    for(auto x:fv)
    {
        if(x.t==0)
        {
            ll tt=query(1,0,N,0,N);
           // PR1(tt,x.z)

            ans=max(ans,tt+x.z);
        }
        else
        {
            //PR1(x.y,x.z)
            update(1,0,N,x.y,N,x.z);

            // for(int i=0;i<12;i++)
            //     cout<<query(1,0,N,i,i)<<" ";ED
        }
    }

    cout<<ans<<endl;

}


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

typedef long long int ll;
typedef unsigned long long int ull;
ll power(ll x,ll y,ll p){ll r=1; x=x%p; while(y>0){ if(y&1) r= r*x%p; y=y>>1; x=x*x%p; } return r; }

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int csrand(int l=0, int r=1e9){
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}

#define PR(x) cout<<#x<<" : "<<x<<"\n";
#define PR1(x,y) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"\n";
#define PR2(x,y,z) cout<<#x<<" : "<<x<<"  |  "<<#y<<" : "<<y<<"  |  "<<#z<<" : "<<z<<"\n";
#define ED cout<<'\n';

#define IO              ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FILEIO          freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define all(v)          v.begin(),v.end()
#define endl            '\n'
#define fr1(j,n)        for(int j=0;j<n;j++)
#define fr(n)           for(int i=0;i<n;i++)
#define PB              push_back
#define pii             pair<int,int>
#define pll             pair<long long int,long long int>
#define F               first
#define S               second

const ll mod=1e9+7;
const ll mod9=998244353;
const int N=1e6+99;

ll stree[(N+5)<<4],lazy[(N+5)<<4];

void push(int nd,int l,int r)
{
    if(lazy[nd]==0)
        return ;
    stree[nd]+=lazy[nd];
    if(l!=r)
    {
        lazy[nd+nd] += lazy[nd];
        lazy[nd+nd+1] += lazy[nd];
    }
    lazy[nd]=0;
}
void update(int nd,int l,int r,int i,int j,ll val)
{
    push(nd,l,r);
    if(r<i || l>j || l>r) return ;
    if(i<=l && r<=j)
    {
        lazy[nd]+=val;
        push(nd,l,r);
        return;
    }
    int lt= nd<<1 , rt=lt|1 , mi=(l+r)/2;
    update(lt,l,mi,i,j,val);
    update(rt,1+mi,r,i,j,val);
    stree[nd]=max(stree[lt],stree[rt]);
}

ll query(int nd,int l,int r,int i,int j)
{
    if(r<i || l>j || l>r)
        return -1e17;
    push(nd,l,r);
    if(i<=l && r<=j)
        return stree[nd];
    int lt= nd<<1 , rt=lt|1 , mi=(l+r)/2;

    return max( query(lt,l,mi,i,j) , query(rt,1+mi,r,i,j));
}

struct st{
    int t,x,y,z;
};
bool comp(st a,st b)
{
    if(a.x!=b.x)
        return a.x<b.x;
    else if(a.t!=b.t)
        return a.t<b.t;
    else
        return a.y<b.y;
}

int main()
{
    IO
    #ifndef ONLINE_JUDGE
    FILEIO
    #endif

    int n,m,p;
    cin>>n>>m>>p;

    vector<pii> ww(n),aa(m),www,aaa;

    fr(n) cin>>ww[i].F>>ww[i].S;
    fr(m) cin>>aa[i].F>>aa[i].S;

    sort(all(ww));
    sort(all(aa));

    for(auto x:ww)
    {
        while(!www.empty() && www.back().S>=x.S) www.pop_back();

        if(www.empty())
            www.PB(x);
        else if(www.back().F!=x.F)
            www.PB(x);

    }

    for(auto x:aa)
    {
        while(!aaa.empty() && aaa.back().S>=x.S) aaa.pop_back();

        if(aaa.empty())
            aaa.PB(x);
        else if(aaa.back().F!=x.F)
            aaa.PB(x);

    }
    aa.clear();ww.clear();
    aa=www;
    ww=aaa;
    n=ww.size();
    m=aa.size();

    vector<st> fv;

    for(auto x:aa)
    {
        st tmp;
        tmp.t=0;
        tmp.x=x.F;
        tmp.z=-x.S;
        fv.PB(tmp);
    }

    fr(p)
    {
        st tmp;
        tmp.t=1;
        cin>>tmp.x>>tmp.y>>tmp.z;
        fv.PB(tmp);
    }

    sort(all(fv),comp);

    int pr=0;
    for(auto x:ww)
    {
        update(1,0,N,pr,x.F-1,-x.S);
        pr=x.F;
    }
    update(1,0,N,pr,N,-1e17);

    // for(int i=0;i<12;i++)
    //     cout<<query(1,0,N,i,i)<<" ";ED

    ll ans=-1e17;

    for(auto x:fv)
    {
        if(x.t==0)
        {
            ll tt=query(1,0,N,0,N);
           // PR1(tt,x.z)

            ans=max(ans,tt+x.z);
        }
        else
        {
            //PR1(x.y,x.z)
            update(1,0,N,x.y,N,x.z);

            // for(int i=0;i<12;i++)
            //     cout<<query(1,0,N,i,i)<<" ";ED
        }
    }

    cout<<ans<<endl;

}


#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>	//scanf,printf
#include<cstring>	//memcpy,memset,strcpy
#include<vector>	//lower_bound, unique
#include<cmath>		//log,acos
#include<algorithm>	//sort
#include<iostream>	//cin,cout
#include<map>
#include<string>	//string
#include<utility>	//pair
#include<queue>
#include<functional>	//greater,less
using namespace std;

const int maxn = 2e5 + 1;
pair<int, int>a[maxn], b[maxn];
struct monster {
	int x, y, z;
}ms[maxn];

bool cmp(monster& a, monster& b) {
	if (a.x == b.x)return a.y < b.y;
	return a.x < b.x;
}

int f[maxn], bel[maxn], mx[maxn], flag[maxn], B, nB, cur, ans;
int n, m, p;

void build() {
	B = min(m, int(sqrt(m) + 1));
	int i(0);
	cur = ans = -INT_MAX;
	while (i < m) {
		mx[++nB] = -INT_MAX;
		for (int j = 0; j < B&&i < m; i++, j++) {
			f[i] = -b[i].second;
			mx[nB] = max(mx[nB], f[i]);
			bel[i] = nB;
		}
		cur = max(cur, mx[nB]);
	}
}

void add(int k) {
	int i = upper_bound(b, b + m, make_pair(ms[k].y, INT_MAX)) - b;
	if (i >= m)return;
	int z = ms[k].z;
	if (i%B != 0) {		//i���ǿ���Ԫ��
		int Bi = bel[i];
		while (bel[i] == Bi) {
			f[i] += z;
			mx[Bi] = max(mx[Bi], f[i] + flag[i]);
			i++;
		}
		cur = max(cur, mx[Bi]);
	}
	for (int j = bel[i]; j <= nB; j++) {
		flag[j] += z;
		mx[j] += z;
		cur = max(cur, mx[j]);
	}
}

int main() {
	scanf("%d%d%d", &n, &m, &p);
	for (int i = 0; i < n; i++)scanf("%d%d", &a[i].first, &a[i].second);
	for (int i = 0; i < m; i++)scanf("%d%d", &b[i].first, &b[i].second);
	for (int i = 0; i < p; i++)scanf("%d%d%d", &ms[i].x, &ms[i].y, &ms[i].z);
	sort(a, a + n);
	sort(b, b + m);
	sort(ms, ms + p, cmp);
	build();
	int k(0);
	for (int i = 0; i < n; i++) {
		while (k < p&&ms[k].x < a[i].first)add(k++);
		ans = max(ans, cur - a[i].second);
	}
	printf("%d", ans);
	return 0;
}
/*
3 5
2 4 2
1 3
3 5
3 7
5 9
1 10
*/
/*
class Solution {
public:
	vector<string> Permutation(string str) {
		sort(str.begin(), str.end());
		vector<string> ans;
		do {
			//cout << str << endl;
			ans.push_back(str);
		} while (next_permutation(str.begin(), str.end()));
		return ans;
	}
};

int main() {
	string s;
	cin >> s;
	Solution().Permutation(s);
	return 0;
}*/
/*
struct Envelope {
	int length, width;

	inline bool operator< (const Envelope &x) const {
		return width < x.width || width == x.width && length > x.length;
	}
};

int N;
vector< Envelope > arr;
// dp[i] ��ʾ�� arr[i].length ��β�������������
vector<int> dp;
// smallEnds[i] ��ʾLIS����Ϊ i + 1 ����С��β
vector<int> smallEnds;

int LIS() {
	dp.assign(N, 0);
	smallEnds.clear();

	for (int i = 0; i < N;i++) {
		auto it = lower_bound(smallEnds.begin(), smallEnds.end(), arr[i].length);
		dp[i] = it - smallEnds.begin() + 1;

		if (it != smallEnds.end()) *it = arr[i].length;
		else smallEnds.push_back(arr[i].length);
	}

	return (int)smallEnds.size();
}

int main() {
	//freopen("MyOutput.txt","w",stdout);
	//freopen("input.txt","r",stdin);
	//INIT();
	scanf("%d", &N);
	arr.resize(N);
	for (int i = 0; i < N; i++) scanf("%d%d", &arr[i].length, &arr[i].width);
	sort(arr.begin(), arr.end());
	printf("%d\n", LIS());
	return 0;
}*/
/*
pair<int, int> a[100002];
int main() {
	int n, i;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d%d", &a[i].first, &a[i].second);

	sort(a, a + n);

	for (i = 0; i < n && (a[i].first <= 0 || a[i].second <= 0); i++);
	if (i == n) {
		printf("0");
		return 0;
	}

	int l = a[i].first, w = a[i].second, ans = 1;
	for (i++; i < n; i++) {
		if (a[i].first > l&&a[i].second > w) {
			ans++;
			l = a[i].first;
			w = a[i].second;
		}
	}
	printf("%d", ans);
	return 0;
}*/


#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>	//scanf,printf
#include<cstring>	//memcpy,memset,strcpy
#include<vector>	//lower_bound, unique
#include<cmath>		//log,acos
#include<algorithm>	//sort
#include<iostream>	//cin,cout
#include<map>
#include<string>	//string
#include<utility>	//pair
#include<queue>
#include<functional>	//greater,less
using namespace std;

const int maxn = 2e5 + 1;
pair<int, int>a[maxn], b[maxn];	//�����Ϳ���
struct monster {
	int x, y, z;
}ms[maxn];	//����

bool cmp(monster& a, monster& b) {
	if (a.x == b.x)return a.y < b.y;
	return a.x < b.x;
}
//ÿ�׿��׿ɻ�õ��������f����������bel�������ֵmx����������flag�����СB������nB
//��ǰȫ�����ֵcur���������մ�ans
int f[maxn], bel[maxn], mx[maxn], flag[maxn], B, nB, cur, ans;
int n, m, p;

void build() {		//����ͳ�ʼ��
	B = min(m, int(sqrt(m) + 1));
	int i(0);
	cur = ans = -INT_MAX;
	while (i < m) {
		mx[++nB] = -INT_MAX;	//���±��1��ʼ��������Ĭ�ϳ�ʼ��ֵ0����
		for (int j = 0; j < B&&i < m; i++, j++) {
			f[i] = -b[i].second;
			mx[nB] = max(mx[nB], f[i]);
			bel[i] = nB;
		}
		cur = max(cur, mx[nB]);	//����ɱ����һ����ʱҲ�����������Ϳ��ף����ܲ����¾�ֱ�Ӳ�ȫ����ֵ
	}
}

void add(int k) {
	int i = upper_bound(b, b + m, make_pair(ms[k].y, INT_MAX)) - b;	//���ֵõ���k���޷���������׸��±�
	if (i >= m)return;
	int z = ms[k].z;
	if (i%B != 0) {		//i���ǿ���Ԫ��
		int Bi = bel[i];
		while (bel[i] == Bi) {
			f[i] += z;
			mx[Bi] = max(mx[Bi], f[i] + flag[Bi]);	//�ǵÿ���ÿ��Ԫ�ص�ʵ��ֵ����Ҫ���� ��������
			i++;
		}
		cur = max(cur, mx[Bi]);
	}
	if (i >= m)return;		//������i���ڿ�󣬿��ܺ���û���������ˣ���belĬ��ֵΪ0����ȫ������һ�鵼�´���
	for (int j = bel[i]; j <= nB; j++) {	//���º������п�
		flag[j] += z;
		mx[j] += z;
		cur = max(cur, mx[j]);
	}
}

int main() {
	scanf("%d%d%d", &n, &m, &p);
	for (int i = 0; i < n; i++)scanf("%d%d", &a[i].first, &a[i].second);
	for (int i = 0; i < m; i++)scanf("%d%d", &b[i].first, &b[i].second);
	for (int i = 0; i < p; i++)scanf("%d%d%d", &ms[i].x, &ms[i].y, &ms[i].z);
	sort(a, a + n);
	sort(b, b + m);
	sort(ms, ms + p, cmp);
	build();
	int k(0);
	for (int i = 0; i < n; i++) {
		while (k < p&&ms[k].x < a[i].first)add(k++);	//��p�θ���
		ans = max(ans, cur - a[i].second);		//��n�β�ѯ���ǵü�ȥ�������Ļ���
	}
	printf("%d", ans);
	return 0;
}
/*
3 5
2 4 2
1 3
3 5
3 7
5 9
1 10
*/
/*
class Solution {
public:
	vector<string> Permutation(string str) {
		sort(str.begin(), str.end());
		vector<string> ans;
		do {
			//cout << str << endl;
			ans.push_back(str);
		} while (next_permutation(str.begin(), str.end()));
		return ans;
	}
};

int main() {
	string s;
	cin >> s;
	Solution().Permutation(s);
	return 0;
}*/
/*
struct Envelope {
	int length, width;

	inline bool operator< (const Envelope &x) const {
		return width < x.width || width == x.width && length > x.length;
	}
};

int N;
vector< Envelope > arr;
// dp[i] ��ʾ�� arr[i].length ��β�������������
vector<int> dp;
// smallEnds[i] ��ʾLIS����Ϊ i + 1 ����С��β
vector<int> smallEnds;

int LIS() {
	dp.assign(N, 0);
	smallEnds.clear();

	for (int i = 0; i < N;i++) {
		auto it = lower_bound(smallEnds.begin(), smallEnds.end(), arr[i].length);
		dp[i] = it - smallEnds.begin() + 1;

		if (it != smallEnds.end()) *it = arr[i].length;
		else smallEnds.push_back(arr[i].length);
	}

	return (int)smallEnds.size();
}

int main() {
	//freopen("MyOutput.txt","w",stdout);
	//freopen("input.txt","r",stdin);
	//INIT();
	scanf("%d", &N);
	arr.resize(N);
	for (int i = 0; i < N; i++) scanf("%d%d", &arr[i].length, &arr[i].width);
	sort(arr.begin(), arr.end());
	printf("%d\n", LIS());
	return 0;
}*/
/*
pair<int, int> a[100002];
int main() {
	int n, i;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d%d", &a[i].first, &a[i].second);

	sort(a, a + n);

	for (i = 0; i < n && (a[i].first <= 0 || a[i].second <= 0); i++);
	if (i == n) {
		printf("0");
		return 0;
	}

	int l = a[i].first, w = a[i].second, ans = 1;
	for (i++; i < n; i++) {
		if (a[i].first > l&&a[i].second > w) {
			ans++;
			l = a[i].first;
			w = a[i].second;
		}
	}
	printf("%d", ans);
	return 0;
}*/


#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>	//scanf,printf
#include<cstring>	//memcpy,memset,strcpy
#include<vector>	//lower_bound, unique
#include<cmath>		//log,acos
#include<algorithm>	//sort
#include<iostream>	//cin,cout
#include<map>
#include<string>	//string
#include<utility>	//pair
#include<queue>
#include<functional>	//greater,less
using namespace std;

const int maxn = 2e5 + 1;
pair<int, int>a[maxn], b[maxn];
struct monster {
	int x, y, z;
}ms[maxn];

bool cmp(monster& a, monster& b) {
	if (a.x == b.x)return a.y < b.y;
	return a.x < b.x;
}

int f[maxn], bel[maxn], mx[maxn], flag[maxn], B, nB, cur, ans;
int n, m, p;

void build() {
	B = min(m, int(sqrt(m) + 1));
	int i(0);
	cur = ans = -INT_MAX;
	while (i < m) {
		mx[++nB] = -INT_MAX;
		for (int j = 0; j < B&&i < m; i++, j++) {
			f[i] = -b[i].second;
			mx[nB] = max(mx[nB], f[i]);
			bel[i] = nB;
		}
		cur = max(cur, mx[nB]);
	}
}

void add(int k) {
	int i = upper_bound(b, b + m, make_pair(ms[k].y, INT_MAX)) - b;
	if (i >= m)return;
	int z = ms[k].z;
	if (i%B != 0) {		//i���ǿ���Ԫ��
		int Bi = bel[i];
		while (bel[i] == Bi) {
			f[i] += z;
			mx[Bi] = max(mx[Bi], f[i] + flag[Bi]);
			i++;
		}
		cur = max(cur, mx[Bi]);
	}
	for (int j = bel[i]; j <= nB; j++) {
		flag[j] += z;
		mx[j] += z;
		cur = max(cur, mx[j]);
	}
}

int main() {
	scanf("%d%d%d", &n, &m, &p);
	for (int i = 0; i < n; i++)scanf("%d%d", &a[i].first, &a[i].second);
	for (int i = 0; i < m; i++)scanf("%d%d", &b[i].first, &b[i].second);
	for (int i = 0; i < p; i++)scanf("%d%d%d", &ms[i].x, &ms[i].y, &ms[i].z);
	sort(a, a + n);
	sort(b, b + m);
	sort(ms, ms + p, cmp);
	build();
	int k(0);
	for (int i = 0; i < n; i++) {
		while (k < p&&ms[k].x < a[i].first)add(k++);
		ans = max(ans, cur - a[i].second);
	}
	printf("%d", ans);
	return 0;
}
/*
3 5
2 4 2
1 3
3 5
3 7
5 9
1 10
*/
/*
class Solution {
public:
	vector<string> Permutation(string str) {
		sort(str.begin(), str.end());
		vector<string> ans;
		do {
			//cout << str << endl;
			ans.push_back(str);
		} while (next_permutation(str.begin(), str.end()));
		return ans;
	}
};

int main() {
	string s;
	cin >> s;
	Solution().Permutation(s);
	return 0;
}*/
/*
struct Envelope {
	int length, width;

	inline bool operator< (const Envelope &x) const {
		return width < x.width || width == x.width && length > x.length;
	}
};

int N;
vector< Envelope > arr;
// dp[i] ��ʾ�� arr[i].length ��β�������������
vector<int> dp;
// smallEnds[i] ��ʾLIS����Ϊ i + 1 ����С��β
vector<int> smallEnds;

int LIS() {
	dp.assign(N, 0);
	smallEnds.clear();

	for (int i = 0; i < N;i++) {
		auto it = lower_bound(smallEnds.begin(), smallEnds.end(), arr[i].length);
		dp[i] = it - smallEnds.begin() + 1;

		if (it != smallEnds.end()) *it = arr[i].length;
		else smallEnds.push_back(arr[i].length);
	}

	return (int)smallEnds.size();
}

int main() {
	//freopen("MyOutput.txt","w",stdout);
	//freopen("input.txt","r",stdin);
	//INIT();
	scanf("%d", &N);
	arr.resize(N);
	for (int i = 0; i < N; i++) scanf("%d%d", &arr[i].length, &arr[i].width);
	sort(arr.begin(), arr.end());
	printf("%d\n", LIS());
	return 0;
}*/
/*
pair<int, int> a[100002];
int main() {
	int n, i;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%d%d", &a[i].first, &a[i].second);

	sort(a, a + n);

	for (i = 0; i < n && (a[i].first <= 0 || a[i].second <= 0); i++);
	if (i == n) {
		printf("0");
		return 0;
	}

	int l = a[i].first, w = a[i].second, ans = 1;
	for (i++; i < n; i++) {
		if (a[i].first > l&&a[i].second > w) {
			ans++;
			l = a[i].first;
			w = a[i].second;
		}
	}
	printf("%d", ans);
	return 0;
}*/


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] = val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	ll mi = inf;
    	for(ll i=maxn-1;i>=0;i--)
    	{
    		ll now = fa[i];
    		fa[i] = mi;
    		mi = min(mi,now);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	mi = inf;
    	for(ll i=maxn-1;i>=0;i--)
    	{
    		ll now = fb[i];
    		fb[i] = mi;
    		if(i)
    			modify(1,1,maxn-1,i,0,fb[i]);
    		mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep0(x,maxn)
    	{
    		for(auto it:c[x])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
struct mons{ll x,y,z;}a[maxn];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] = val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	// rep0(i,p)
    	// {
    	// 	ll x, y, z;
    	// 	cin>>x>>y>>z;
    	// 	c[x].pb({y,z});
    	// }
    	ll res = -inf;
    	for(ll i=1;i<=p;++i)
    		cin>>a[i].x>>a[i].y>>a[i].z;
		sort(a+1,a+p+1,[&](const mons&a,const mons&b){return a.x<b.x;});
		for(ll i=0,j=1;i<maxn;++i)
		{
			for(;j<=p && a[j].x<i;++j)
				modify(1,1,maxn-1,a[j].y,a[j].z,fb[a[j].y]);
			res=max(res,mx[1]-fa[i]);
		}
    	// rep1(x,maxn-1)
    	// {
    	// 	for(auto it:c[x-1])
    	// 		modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    	// 	res = max(res,-fa[x]+mx[1]);
    	// 	// trace2(x,res);
    	// }
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] += val, mx[node] = -y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep1(x,maxn-1)
    	{
    		for(auto it:c[x-1])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    		// trace2(x,res);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
struct mons{ll x,y,z;}a[maxn];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] += val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	// rep0(i,p)
    	// {
    	// 	ll x, y, z;
    	// 	cin>>x>>y>>z;
    	// 	c[x].pb({y,z});
    	// }
    	ll res = -inf;
    	for(ll i=1;i<=p;++i)
    		cin>>a[i].x>>a[i].y>>a[i].z;
		sort(a+1,a+p+1,[&](const mons&a,const mons&b){return a.x<b.x;});
		for(ll i=0,j=1;i<maxn;++i)
		{
			for(;j<=p && a[j].x<i;++j)
				modify(1,1,maxn-1,a[j].y,a[j].z,fb[a[j].y]);
			res=max(res,mx[1]-fa[i]);
		}
    	// rep1(x,maxn-1)
    	// {
    	// 	for(auto it:c[x-1])
    	// 		modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    	// 	res = max(res,-fa[x]+mx[1]);
    	// 	// trace2(x,res);
    	// }
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] += val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep1(x,maxn-1)
    	{
    		for(auto it:c[x-1])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    		// trace2(x,res);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] = val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep1(x,maxn-1)
    	{
    		for(auto it:c[x-1])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    		// trace2(x,res);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
struct mons{ll x,y,z;}a[maxn];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] += val, mx[node] = -y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	// rep0(i,p)
    	// {
    	// 	ll x, y, z;
    	// 	cin>>x>>y>>z;
    	// 	c[x].pb({y,z});
    	// }
    	ll res = -inf;
    	for(ll i=1;i<=p;++i)
    		cin>>a[i].x>>a[i].y>>a[i].z;
		sort(a+1,a+p+1,[&](const mons&a,const mons&b){return a.x<b.x;});
		for(ll i=0,j=1;i<maxn;++i)
		{
			for(;j<=p && a[j].x<i;++j)
				modify(1,1,maxn-1,a[j].y,a[j].z,fb[a[j].y]);
			res=max(res,mx[1]-fa[i]);
		}
    	// rep1(x,maxn-1)
    	// {
    	// 	for(auto it:c[x-1])
    	// 		modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    	// 	res = max(res,-fa[x]+mx[1]);
    	// 	// trace2(x,res);
    	// }
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] += val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	ll mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		ll now = fa[i];
    		fa[i] = mi;
    		mi = min(mi,now);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		ll now = fb[i];
    		fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep1(x,maxn-1)
    	{
    		for(auto it:c[x])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] = val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	// ll mi = inf;
    	// for(ll i=maxn-1;i>=1;i--)
    	// {
    	// 	ll now = fa[i];
    	// 	// fa[i] = mi;
    	// 	mi = min(mi,now);
    	// }
    	// mi = inf;
    	rep1(i,maxn-1)
    		mx[i] = -inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		// ll now = fb[i];
    		// fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		// mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep1(x,maxn-1)
    	{
    		for(auto it:c[x-1])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    		// trace2(x,res);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ldb;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define V vector
#define pll pair<ll,ll>
#define endl "\n"
#define CLEAR(a) memset(a,0,sizeof(a))
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define rep0(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define ios_tie() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(nullptr)
#define trace1(a)             cout <<#a<<":"<<a<< endl;
#define trace2(a,b)           cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<< endl;
#define trace3(a,b,c)         cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<endl;
#define trace4(a,b,c,d)       cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<endl;
#define trace5(a,b,c,d,e)     cout <<#a<<":"<<a<<" | "<<#b<<":"<<b<<" | "<<#c<<":"<<c<<" | "<<#d<<":"<<d<<" | "<<#e<<":"<<e<<endl;

const ll inf = 1e18;
const ll mod = 1e9+7;
const ll maxn = 1e6+1;
const ldb PI = acos(-1);

void lol(ll s) {cout<<"check........................................... "<<s<<endl;}
ll power(ll x,ll y) {ll res=1; x%=mod; while(y) {if(y&1) res=(res*x)%mod; y>>=1LL; x=(x*x)%mod; }return res;}
ll inv(ll x) {return power(x,mod-2);}//(1/x)%y = x^(y-2) % y;   // pow(x,y)%m = pow(x,y%(m-1))%m
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

// bhenchod rating kyu nhi bhad rhi
ll fa[maxn], fb[maxn];
V<pll> c[maxn];
ll sum[4*maxn+1];
ll mx[4*maxn+1];
void modify(ll node, ll start, ll end, ll idx, ll val, ll y)
{
    if(start == end)
        sum[node] = val, mx[node] = val-y;
    else
    {
        ll mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
            modify(2*node, start, mid, idx, val, y);
        else
            modify(2*node+1, mid+1, end, idx, val, y);
        sum[node] = sum[2*node]+sum[2*node+1];
        mx[node] = max(mx[2*node],sum[2*node]+mx[2*node+1]);
    }
}
int main()
{
    ios_tie();
	// freopen("input.txt", "r", stdin);
	// freopen("opt.txt", "w", stdout);
    ll tc = 1;
    // cin>>tc;
    while(tc--)
    {
    	ll n, m, p;
    	cin>>n>>m>>p;
    	rep0(i,maxn)
    		fa[i] = fb[i] = inf;
    	rep0(i,n)
    	{
    		ll ai, cai;
    		cin>>ai>>cai;
    		fa[ai] = min(fa[ai],cai);
    	}
    	ll mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		ll now = fa[i];
    		fa[i] = mi;
    		mi = min(mi,now);
    	}
    	rep0(i,m)
    	{
    		ll bi, cbi;
    		cin>>bi>>cbi;
    		fb[bi] = min(fb[bi],cbi);
    	}
    	mi = inf;
    	for(ll i=maxn-1;i>=1;i--)
    	{
    		ll now = fb[i];
    		fb[i] = mi;
    		modify(1,1,maxn-1,i,0,fb[i]);
    		mi = min(mi,now);
    	}
    	rep0(i,p)
    	{
    		ll x, y, z;
    		cin>>x>>y>>z;
    		c[x].pb({y,z});
    	}
    	ll res = -inf;
    	rep1(x,maxn-1)
    	{
    		for(auto it:c[x])
    			modify(1,1,maxn-1,it.ff,it.ss,fb[it.ff]);
    		res = max(res,-fa[x]+mx[1]);
    	}
    	cout<<res<<endl;
    }
    return 0;
}


/*
 * Author:  heyuhhh
 * Created Time:  2020/3/1 22:51:58
 */
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#define MP make_pair
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define INF 0x3f3f3f3f
#define Local
#ifdef Local
  #define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
  void err() { std::cout << '\n'; }
  template<typename T, typename...Args>
  void err(T a, Args...args) { std::cout << a << ' '; err(args...); }
#else
  #define dbg(...)
#endif
void pt() {std::cout << '\n'; }
template<typename T, typename...Args>
void pt(T a, Args...args) {std::cout << a << ' '; pt(args...); }
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//head
const int N = 1e6 + 5;

int n, m, p;
pii a[N], b[N];
ll mina[N], minb[N];

struct monster {
    int x, y, z;
    bool operator < (const monster &A) const {
        return x < A.x;
    }
}c[N];

ll maxv[N << 2], lz[N << 2];
ll d[N];

void push_up(int o) {
    maxv[o] = max(maxv[o << 1], maxv[o << 1|1]);
}

void tag(int o, int l, int r, ll v) {
    maxv[o] += v;
    lz[o] += v;
}

void push_down(int o, int l, int r) {
    if(lz[o]) {
        int mid = (l + r) >> 1;
        tag(o << 1, l, mid, lz[o]);
        tag(o << 1|1, mid + 1, r, lz[o]);
        lz[o] = 0;
    }
}

void build(int o, int l, int r) {
    if(l == r) {
        maxv[o] = -d[l];
        return;
    }
    int mid = (l + r) >> 1;
    build(o << 1, l, mid), build(o << 1|1, mid + 1, r);
    push_up(o);
}

void update(int o, int l, int r, int L, int R, ll v) {
    if(L <= l && r <= R) {
        tag(o, l, r, v);
        return;
    }
    push_down(o, l, r);
    int mid = (l + r) >> 1;
    if(L <= mid) update(o << 1, l, mid, L, R, v);
    if(R > mid) update(o << 1|1, mid + 1, r, L, R, v);
    push_up(o);
}

ll query(int o, int l, int r, int L, int R) {
    if(L <= l && r <= R) {
        return maxv[o];
    }
    push_down(o, l, r);
    int mid = (l + r) >> 1;
    ll res = -1e18;
    if(L <= mid) res = query(o << 1, l, mid, L, R);
    if(R > mid) res = max(res, query(o << 1|1, mid + 1, r, L, R));
    return res;
}

void run(){
    for(int i = 1; i <= n; i++) cin >> a[i].fi >> a[i].se;
    for(int i = 1; i <= m; i++) cin >> b[i].fi >> b[i].se;
    sort(a + 1, a + n + 1, [&](pii A, pii B) {
        return A.fi < B.fi;
    });
    sort(b + 1, b + m + 1, [&](pii A, pii B) {
        return A.fi < B.fi;
    });
    vector <int> aa;
    for(int i = 1; i <= n; i++) aa.push_back(a[i].fi);
    mina[n + 1] = minb[m + 1] = INF;
    for(int i = n; i >= 1; i--) mina[i] = min(mina[i + 1], (ll)a[i].se);
    for(int i = m; i >= 1; i--) minb[i] = min(minb[i + 1], (ll)b[i].se);
    for(int i = 1; i <= p; i++) {
        cin >> c[i].x >> c[i].y >> c[i].z;
    }
    sort(c + 1, c + p + 1);
    memset(d, INF, sizeof(d));
    for(int i = 1; i <= m; i++) {
        d[b[i].fi] = min(d[b[i].fi], (ll)b[i].se);
    }
    build(1, 1, N - 1);
    ll ans = -mina[1] - minb[1];
    for(int i = 1; i <= p; i++) {
        update(1, 1, N - 1, c[i].y + 1, N - 1, c[i].z);
        ll t = query(1, 1, N - 1, c[i].y + 1, N - 1);
        int tt = upper_bound(all(aa), c[i].x) - aa.begin() + 1;
        ans = max(ans, t - mina[tt]);
    }
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cout << fixed << setprecision(20);
    while(cin >> n >> m >> p) run();
    return 0;
}


/*
 * Author:  heyuhhh
 * Created Time:  2020/3/1 22:51:58
 */
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#define MP make_pair
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define INF 0x3f3f3f3f
#define Local
#ifdef Local
  #define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
  void err() { std::cout << '\n'; }
  template<typename T, typename...Args>
  void err(T a, Args...args) { std::cout << a << ' '; err(args...); }
#else
  #define dbg(...)
#endif
void pt() {std::cout << '\n'; }
template<typename T, typename...Args>
void pt(T a, Args...args) {std::cout << a << ' '; pt(args...); }
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
//head
const int N = 1e6 + 5;

int n, m, p;
pii a[N], b[N];
int mina[N], minb[N];

struct monster {
    int x, y, z;
    bool operator < (const monster &A) const {
        return x < A.x;
    }
}c[N];

ll maxv[N << 2], lz[N << 2];
int d[N];

void push_up(int o) {
    maxv[o] = max(maxv[o << 1], maxv[o << 1|1]);
}

void tag(int o, int l, int r, ll v) {
    maxv[o] += v;
    lz[o] += v;
}

void push_down(int o, int l, int r) {
    if(lz[o]) {
        int mid = (l + r) >> 1;
        tag(o << 1, l, mid, lz[o]);
        tag(o << 1|1, mid + 1, r, lz[o]);
        lz[o] = 0;
    }
}

void build(int o, int l, int r) {
    if(l == r) {
        maxv[o] = -d[l];
        return;
    }
    int mid = (l + r) >> 1;
    build(o << 1, l, mid), build(o << 1|1, mid + 1, r);
    push_up(o);
}

void update(int o, int l, int r, int L, int R, ll v) {
    if(L <= l && r <= R) {
        tag(o, l, r, v);
        return;
    }
    push_down(o, l, r);
    int mid = (l + r) >> 1;
    if(L <= mid) update(o << 1, l, mid, L, R, v);
    if(R > mid) update(o << 1|1, mid + 1, r, L, R, v);
    push_up(o);
}

ll query(int o, int l, int r, int L, int R) {
    if(L <= l && r <= R) {
        return maxv[o];
    }
    push_down(o, l, r);
    int mid = (l + r) >> 1;
    ll res = -1e18;
    if(L <= mid) res = query(o << 1, l, mid, L, R);
    if(R > mid) res = max(res, query(o << 1|1, mid + 1, r, L, R));
    return res;
}

void run(){
    for(int i = 1; i <= n; i++) cin >> a[i].fi >> a[i].se;
    for(int i = 1; i <= m; i++) cin >> b[i].fi >> b[i].se;
    sort(a + 1, a + n + 1, [&](pii A, pii B) {
        return A.fi < B.fi;
    });
    sort(b + 1, b + m + 1, [&](pii A, pii B) {
        return A.fi < B.fi;
    });
    vector <int> aa, bb;
    for(int i = 1; i <= n; i++) aa.push_back(a[i].fi);
    for(int i = 1; i <= m; i++) bb.push_back(b[i].fi);
    mina[n + 1] = minb[m + 1] = INF;
    for(int i = n; i >= 1; i--) mina[i] = min(mina[i + 1], a[i].se);
    for(int i = m; i >= 1; i--) minb[i] = min(minb[i + 1], b[i].se);
    for(int i = 1; i <= p; i++) {
        cin >> c[i].x >> c[i].y >> c[i].z;
    }
    sort(c + 1, c + p + 1);
    memset(d, INF, sizeof(d));
    for(int i = 1; i <= p; i++) {
        int t = upper_bound(all(bb), c[i].y) - bb.begin() + 1;
        d[c[i].y] = min(d[c[i].y], minb[t]);
    }
    build(1, 1, 1e6);
    ll ans = -mina[1] - minb[1];
    for(int i = 1; i <= p; i++) {
        update(1, 1, 1e6, c[i].y, 1e6, c[i].z);
        ll t = query(1, 1, 1e6, c[i].y, 1e6);
        int tt = upper_bound(all(aa), c[i].x) - aa.begin() + 1;
        ans = max(ans, t - mina[tt]);
    }
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cout << fixed << setprecision(20);
    while(cin >> n >> m >> p) run();
    return 0;
}