/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

#ifndef CM_BST_HPP
#define CM_BST_HPP

template<class T, class T1>
class BST {
private:
    class Node {
    public :
        T data;
        Node *leftChild;
        Node *rightChild;
        T1 leftCount, rightCount, height, totalCount;

        Node(T data) {
            this->data = data;
            this->leftChild = NULL;
            this->rightChild = NULL;
            this->leftCount = 0;
            this->rightCount = 0;
            this->height = 1;
            this->totalCount = 1;
        }

        Node(T data, T1 totalCount) {
            this->data = data;
            this->leftChild = NULL;
            this->rightChild = NULL;
            this->leftCount = 0;
            this->rightCount = 0;
            this->height = 1;
            this->totalCount = totalCount;
        }
    };

    Node *rootNode;
    Node *temporaryNode1;
    Node *temporaryNode2;
    T1 treeSize;
    bool multiCount;

    T1 getDiff(Node *temp) {
        if (temp == NULL) return 0;
        return getheight(temp->leftChild) - getheight(temp->rightChild);
    }

    T1 getheight(Node *temp) {
        if (temp == NULL) return 0;
        return temp->height;
    }

    Node *rightRotate(Node *temp) {
        temporaryNode1 = temp->leftChild;
        temporaryNode2 = temporaryNode1->rightChild;
        temporaryNode1->rightChild = temp;
        temp->leftChild = temporaryNode2;
        //height updation
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        temporaryNode1->height =
                std::max(getheight(temporaryNode1->leftChild), getheight(temporaryNode1->rightChild)) + 1;
        //totalCount updation
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        if (temporaryNode1->leftChild != NULL)
            temporaryNode1->leftCount =
                    temporaryNode1->leftChild->leftCount + temporaryNode1->leftChild->rightCount +
                    temporaryNode1->leftChild->totalCount;
        else temporaryNode1->leftCount = 0;
        if (temporaryNode1->rightChild != NULL)
            temporaryNode1->rightCount =
                    temporaryNode1->rightChild->leftCount + temporaryNode1->rightChild->rightCount +
                    temporaryNode1->rightChild->totalCount;
        else temporaryNode1->rightCount = 0;
        return temporaryNode1;
    }

    Node *leftRotate(Node *temp) {
        temporaryNode1 = temp->rightChild;
        temporaryNode2 = temporaryNode1->leftChild;
        temporaryNode1->leftChild = temp;
        temp->rightChild = temporaryNode2;
        //height updation
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        temporaryNode1->height =
                std::max(getheight(temporaryNode1->leftChild), getheight(temporaryNode1->rightChild)) + 1;
        //totalCount updation
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        if (temporaryNode1->leftChild != NULL)
            temporaryNode1->leftCount =
                    temporaryNode1->leftChild->leftCount + temporaryNode1->leftChild->rightCount +
                    temporaryNode1->leftChild->totalCount;
        else temporaryNode1->leftCount = 0;
        if (temporaryNode1->rightChild != NULL)
            temporaryNode1->rightCount =
                    temporaryNode1->rightChild->leftCount + temporaryNode1->rightChild->rightCount +
                    temporaryNode1->rightChild->totalCount;
        else temporaryNode1->rightCount = 0;
        return temporaryNode1;
    }

    Node *remove(Node *temp, T &data, T1 totalCount) {
        if (temp == NULL) return temp;
        if (data < temp->data) temp->leftChild = remove(temp->leftChild, data, totalCount);
        else if (data > temp->data) temp->rightChild = remove(temp->rightChild, data, totalCount);
        else {
            if (multiCount && totalCount < temp->totalCount && temp->totalCount > 1) {
                treeSize -= totalCount;
                temp->totalCount -= totalCount;
            } else {
                treeSize -= temp->totalCount;
                if (temp->leftChild == NULL && temp->rightChild == NULL) return NULL;
                else if (temp->leftChild == NULL) return temp->rightChild;
                else if (temp->rightChild == NULL) return temp->leftChild;
                else {
                    temporaryNode1 = minValue(temp->rightChild);
                    temp->data = temporaryNode1->data;
                    temp->totalCount = temporaryNode1->totalCount;
                    temp->rightChild = remove(temp->rightChild, temporaryNode1->data, temporaryNode1->totalCount);
                    treeSize += temp->totalCount;
                }
            }
        }
        // for leftside and rightside count
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;

        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        //Balancing
        T1 diff = getDiff(temp);
        if (diff > 1) {
            if (getDiff(temp->leftChild) >= 0) {
                temp = rightRotate(temp);
            } else {
                temp->leftChild = leftRotate(temp->leftChild);
                temp = rightRotate(temp);
            }
        } else if (diff < -1) {
            if (getDiff(temp->rightChild) <= 0) {
                temp = leftRotate(temp);
            } else {
                temp->rightChild = rightRotate(temp->rightChild);
                temp = leftRotate(temp);
            }
        }
        return temp;
    }

    Node *minValue(Node *temp) {
        temporaryNode1 = temp;
        while (temporaryNode1->leftChild != NULL) temporaryNode1 = temporaryNode1->leftChild;
        return temporaryNode1;
    }

    Node *insert(Node *temp, T &data, T1 totalCount) {
        if (temp == NULL) {
            if (multiCount) {
                treeSize += totalCount;
                return new Node(data, totalCount);
            } else {
                treeSize++;
                return new Node(data);
            }
        }
        if (data < temp->data) temp->leftChild = insert(temp->leftChild, data, totalCount);
        else if (data > temp->data) temp->rightChild = insert(temp->rightChild, data, totalCount);
        else if (multiCount) {
            treeSize += totalCount;
            temp->totalCount += totalCount;
        }
        // for __leftside and rightCount totalCount
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        //Balancing
        T1 diff = getDiff(temp);
        if (diff > 1) {
            if (data < temp->leftChild->data) {
                temp = rightRotate(temp);
            } else if (data > temp->leftChild->data) {
                temp->leftChild = leftRotate(temp->leftChild);
                temp = rightRotate(temp);
            }
        } else if (diff < -1) {
            if (data > (temp->rightChild->data)) {
                temp = leftRotate(temp);
            } else if (data < temp->rightChild->data) {
                temp->rightChild = rightRotate(temp->rightChild);
                temp = leftRotate(temp);
            }
        }
        return temp;
    }

public :

    BST() {
        rootNode = NULL;
        treeSize = 0;
        multiCount = false;
    }

    BST(bool multiCount) {
        rootNode = NULL;
        treeSize = 0;
        this->multiCount = multiCount;
    }

    T1 lower_bound(T data) {
        temporaryNode1 = rootNode;
        T1 index = 0;
        while (temporaryNode1 != NULL) {
            if (data < temporaryNode1->data) {
                temporaryNode1 = temporaryNode1->leftChild;
            } else if (data > temporaryNode1->data) {
                index += (temporaryNode1->totalCount + temporaryNode1->leftCount);
                temporaryNode1 = temporaryNode1->rightChild;
            } else {
                index += (temporaryNode1->leftCount);
                break;
            }
        }
        return index;
    }

    T get(T1 index) {
        temporaryNode1 = rootNode;
        T1 current = 0;
        while (temporaryNode1 != NULL) {
            if (temporaryNode1->leftChild == NULL) {
                if (temporaryNode1->totalCount + current > index) return temporaryNode1->data;
                else {
                    current += temporaryNode1->totalCount;
                    temporaryNode1 = temporaryNode1->rightChild;
                }
            } else {
                if (current + temporaryNode1->leftCount > index) temporaryNode1 = temporaryNode1->leftChild;
                else if (current + temporaryNode1->leftCount + temporaryNode1->totalCount > index)
                    return temporaryNode1->data;
                else {
                    current += temporaryNode1->totalCount + temporaryNode1->leftCount;
                    temporaryNode1 = temporaryNode1->rightChild;
                }
            }
        }
        assert("Not possible");
    }

    void insert(T data, T1 totalCount = 1) {
        if (totalCount > 0) rootNode = insert(rootNode, data, totalCount);
    }

    void remove(T data, T1 totalCount = 1) {
        if (totalCount > 0) rootNode = remove(rootNode, data, totalCount);
    }

    T1 getCount(T data) {
        temporaryNode1 = rootNode;
        while (temporaryNode1 != NULL) {
            if (data < temporaryNode1->data) temporaryNode1 = temporaryNode1->leftChild;
            else if (data > temporaryNode1->data) temporaryNode1 = temporaryNode1->rightChild;
            else return temporaryNode1->totalCount;
        }
        return 0;
    }

    bool contains(T data) {
        temporaryNode1 = rootNode;
        while (temporaryNode1 != NULL) {
            if (data == temporaryNode1->data) return true;
            else if (data < temporaryNode1->data) temporaryNode1 = temporaryNode1->leftChild;
            else temporaryNode1 = temporaryNode1->rightChild;
        }
        return false;
    }

    T1 size() {
        return this->treeSize;
    }
};

#endif //CM_BST_HPP

using namespace std;

class CWorldOfDarkraftBattleForAzathoth {
public:
    struct Node {
        Node *l = 0, *r = 0;
        int lo, hi;
        long long madd = 0, val = -1e18;

        Node(vector<int> &v, int lo, int hi) : lo(lo), hi(hi) {
            if (lo + 1 < hi) {
                int mid = lo + (hi - lo) / 2;
                l = new Node(v, lo, mid);
                r = new Node(v, mid, hi);
                val = max(l->val, r->val);
            } else val = -v[lo];
        }

        long long query(int L, int R) {
            if (R <= lo || hi <= L) return -1e18;
            if (L <= lo && hi <= R) return val;
            push();
            return max(l->query(L, R), r->query(L, R));
        }

        void add(int L, int R, long long x) {
            if (R <= lo || hi <= L) return;
            if (L <= lo && hi <= R) {
                madd += x;
                val += x;
            } else {
                push(), l->add(L, R, x), r->add(L, R, x);
                val = max(l->val, r->val);
            }
        }

        void push() {
            if (madd)
                l->add(lo, hi, madd), r->add(lo, hi, madd), madd = 0;
        }
    };

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense;
        for (int i = 0; i < m; i++) tempDefense.push_back(defense[i].second);
        Node nd(tempDefense, 0, m);
        int pointerC = 0;
        long long ans = LLONG_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                int index = m;
                {
                    int low = 0;
                    int high = m - 1;
                    while (low <= high) {
                        int mid = (low + high) >> 1;
                        if (defense[mid].first > monster[pointerC].second.first) {
                            index = mid;
                            high = mid - 1;
                        } else {
                            low = mid + 1;
                        }
                    }
                }
                nd.add(index, m, monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, nd.query(0, m) - attack[i].second);
        }
        out << ans << "\n";
    }
};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

const int N = 1000005;
int b[N];
int t[N << 1];
int d[N];
const int h = sizeof(int) * 8 - __builtin_clz(N);

inline void apply(int p, int value) {
    t[p] += value;
    if (p < N) d[p] += value;
}

inline void build1() {
    for (int i = N - 1; i > 0; --i) t[i] = max(t[i << 1], t[i << 1 | 1]);
}

inline void build(int p) {
    while (p > 1) p >>= 1, t[p] = max(t[p << 1], t[p << 1 | 1]) + d[p];
}

inline void push(int p) {
    for (int s = h; s > 0; --s) {
        int i = p >> s;
        if (d[i] != 0) {
            apply(i << 1, d[i]);
            apply(i << 1 | 1, d[i]);
            d[i] = 0;
        }
    }
}

inline void inc(int l, int r, int value) {
    l += N, r += N;
    int l0 = l, r0 = r;
    for (; l < r; l >>= 1, r >>= 1) {
        if (l & 1) apply(l++, value);
        if (r & 1) apply(--r, value);
    }
    build(l0);
    build(r0 - 1);
}

inline int query(int l, int r) {
    l += N, r += N;
    push(l);
    push(r - 1);
    int res = -2e9;
    for (; l < r; l >>= 1, r >>= 1) {
        if (l & 1) res = max(res, t[l++]);
        if (r & 1) res = max(t[--r], res);
    }
    return res;
}

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        for (int i = 0; i < N; i++) b[i] = 2e9;
        for (int i = 0; i < m; i++) {
            if (defense[i].second < b[defense[i].first]) {
                b[defense[i].first] = defense[i].second;
            }
        }
        for (int i = 0; i < N; i++) t[i + N] = -b[i];
        build1();
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                inc(monster[pointerC].second.first + 1, 1000000 + 1,
                    monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, query(0, 1000001) - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

template<typename T>
struct Array {
    T *ar;
    int n;

    Array() {
        ar = NULL;
        n = 0;
    }

    Array(int n, T m = 0) : n(n) {

        ar = new T[n];
        for (int i = 0; i < n; i++) ar[i] = m;
    }

    T &operator[](int index) {
        assert(index < n);
        return ar[index];
    }
};

using namespace std;

struct segment {
    int N;
    Array<int> t;
    Array<int> d;
    int h;

    segment(int N, vector<int> &b) {
        this->N = N;
        t = N << 1;
        d = N;
        h = sizeof(int) * 8 - __builtin_clz(N);
        for (int i = 0; i < N; i++) t[i + N] = -b[i];
        build1();
    }

    void apply(int p, int value) {
        t[p] += value;
        if (p < N) d[p] += value;
    }

    void build1() {
        for (int i = N - 1; i > 0; --i) t[i] = max(t[i << 1], t[i << 1 | 1]);
    }

    void build(int p) {
        while (p > 1) p >>= 1, t[p] = max(t[p << 1], t[p << 1 | 1]) + d[p];
    }

    void push(int p) {
        for (int s = h; s > 0; --s) {
            int i = p >> s;
            if (d[i] != 0) {
                apply(i << 1, d[i]);
                apply(i << 1 | 1, d[i]);
                d[i] = 0;
            }
        }
    }

    void inc(int l, int r, int value) {
        l += N, r += N;
        int l0 = l, r0 = r;
        for (; l < r; l >>= 1, r >>= 1) {
            if (l & 1) apply(l++, value);
            if (r & 1) apply(--r, value);
        }
        build(l0);
        build(r0 - 1);
    }

    int query(int l, int r) {
        l += N, r += N;
        push(l);
        push(r - 1);
        int res = -2e9;
        for (; l < r; l >>= 1, r >>= 1) {
            if (l & 1) res = max(res, t[l++]);
            if (r & 1) res = max(t[--r], res);
        }
        return res;
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> b(1000005, 2e9);
        for (int i = 0; i < m; i++) {
            if (defense[i].second < b[defense[i].first]) {
                b[defense[i].first] = defense[i].second;
            }
        }
        segment st(1000005, b);
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                st.inc(monster[pointerC].second.first + 1, 1000000 + 1,
                       monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, st.query(0, 1000001) - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

class CWorldOfDarkraftBattleForAzathoth {
public:
    struct Node {
        Node *l = 0, *r = 0;
        int lo, hi;
        long long madd = 0, val = -1e18;

        Node(vector<int> &v, int lo, int hi) : lo(lo), hi(hi) {
            if (lo + 1 < hi) {
                int mid = lo + (hi - lo) / 2;
                l = new Node(v, lo, mid);
                r = new Node(v, mid, hi);
                val = max(l->val, r->val);
            } else val = -v[lo];
        }

        long long query(int L, int R) {
            if (R <= lo || hi <= L) return -1e18;
            if (L <= lo && hi <= R) return val;
            push();
            return max(l->query(L, R), r->query(L, R));
        }

        void add(int L, int R, long long x) {
            if (R <= lo || hi <= L) return;
            if (L <= lo && hi <= R) {
                madd += x;
                val += x;
            } else {
                push(), l->add(L, R, x), r->add(L, R, x);
                val = max(l->val, r->val);
            }
        }

        void push() {
            if (madd)
                l->add(lo, hi, madd), r->add(lo, hi, madd), madd = 0;
        }
    };

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense;
        for (int i = 0; i < m; i++) tempDefense.push_back(defense[i].second);
        Node nd(tempDefense, 0, m);
        int pointerC = 0;
        long long ans = LLONG_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                int index = m;
                {
                    int low = 0;
                    int high = m - 1;
                    while (low <= high) {
                        int mid = (low + high) >> 1;
                        if (defense[mid].first > monster[pointerC].second.first) {
                            index = mid;
                            high = mid - 1;
                        } else {
                            low = mid + 1;
                        }
                    }
                }
                nd.add(index, m, monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, nd.query(0, m) - attack[i].second);
        }
        out << ans << "\n";
    }
};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

pair<int, int> attack[100005 << 1];
pair<int, int> defense[100005 << 1];
pair<int, pair<int, int>> monster[100005 << 1];
int tempDefense[1000001];

struct SegmentTree {
public:
    long long val[1000005 << 2];
    int tag[1000005 << 2];

    void pu(int u) {
        val[u] = max(val[u << 1], val[(u << 1 | 1)]);
    }

    void pushdown(int u) {
        if (tag[u]) {
            val[u << 1] += tag[u], tag[u << 1] += tag[u];
            val[(u << 1 | 1)] += tag[u], tag[(u << 1 | 1)] += tag[u];
            tag[u] = 0;
        }
    }

    void build(int u, int l, int r) {
        if (l == r) {
            if (!tempDefense[l]) {
                val[u] = -1e18;
            } else {
                val[u] = -tempDefense[l];
            }
            return;
        }
        int mid = l + r >> 1;
        build(u << 1, l, mid);
        build((u << 1 | 1), mid + 1, r);
        pu(u);
    }

    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return;
        }
        pushdown(u);
        int mid = l + r >> 1;
        if (ql <= mid) update(u << 1, l, mid, ql, qr, x);
        if (qr > mid) update((u << 1 | 1), mid + 1, r, ql, qr, x);
        pu(u);
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack, attack + n);
        sort(defense, defense + m);
        sort(monster, monster + p);
        for (int i = 0; i < m; i++) {
            if (!tempDefense[defense[i].first] || defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }
        SegmentTree smt;
        smt.build(1, 1, 1000000);
        int pointerC = 0;
        long long ans = LLONG_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                smt.update(1, 1, 1000000, monster[pointerC].second.first + 1, 1000000,
                           monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, smt.val[1] - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

struct SegmentTree {
public:
    int val[1000005 << 2];
    int tag[1000005 << 2];

    void build(int u, int l, int r, vector<int> &ff) {
        if (l == r) {
            if (!ff[l]) {
                val[u] = INT32_MIN;
            } else {
                val[u] = -ff[l];
            }
            return;
        }
        int mid = l + r >> 1;
        build(u << 1, l, mid, ff);
        build((u << 1 | 1), mid + 1, r, ff);
        val[u] = max(val[u << 1], val[(u << 1 | 1)]);
    }

    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return;
        }
        if (tag[u]) {
            val[u << 1] += tag[u], tag[u << 1] += tag[u];
            val[(u << 1 | 1)] += tag[u], tag[(u << 1 | 1)] += tag[u];
            tag[u] = 0;
        }

        int mid = l + r >> 1;
        if (ql <= mid) update(u << 1, l, mid, ql, qr, x);
        if (qr > mid) update((u << 1 | 1), mid + 1, r, ql, qr, x);
        val[u] = max(val[u << 1], val[(u << 1 | 1)]);
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense(1000001);
        for (int i = 0; i < m; i++) {
            if (!tempDefense[defense[i].first] || defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }
        SegmentTree smt;
        smt.build(1, 1, 1000000, tempDefense);
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                smt.update(1, 1, 1000000, monster[pointerC].second.first + 1, 1000000,
                           monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, smt.val[1] - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define I inline int
#define V inline void
#define B inline bool
#define ll long long int
#define isnum(ch) ('0'<=ch&&ch<='9')
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define ROF(i,a,b) for(int i=a;i>=b;i--)
#define gc (_op==_ed&&(_ed=(_op=_buf)+fread(_buf,1,100000,stdin),_op==_ed)?EOF:*_op++)
char _buf[100000],*_op(_buf),*_ed(_buf);
I getint(){
	static const int flag[2]={1,-1};
	int _s=0,_f=1;char _ch=gc;
	while(!isnum(_ch))_f=flag[_ch=='-'],_ch=gc;
	while(isnum(_ch))_s=_s*10+_ch-48,_ch=gc;
	return _s*_f;
}
const int N=5e5+1,INF=0x7fffffff;
int n,m,k,tot,rt,ans=-INF;
struct node{
	int v,c;
	V input(){
		v=getint(),c=getint();
	}
	B operator<(const node&u)const{
		return v<u.v;
	}
}a[N],b[N],tmp[N];
struct data{
	int a,b,c;
	V input(){
		a=getint(),b=getint(),c=getint();
	}
	B operator<(const data&u)const{
		return a<u.a;
	}
}c[N];
int maxn[N<<2],tag[N<<2];
V input(){
	n=getint(),m=getint(),k=getint();
	FOR(i,1,n)a[i].input();
	FOR(i,1,m)b[i].input();
	FOR(i,1,k)c[i].input();
}
#define lc p<<1
#define rc lc|1
#define root 1,1,m
#define lson lc,L,mid
#define rson rc,mid+1,R
V update(int p){
	maxn[p]=max(maxn[lc],maxn[rc]);
}
V solve(int p){
	if(!tag[p])return;
	tag[lc]+=tag[p],maxn[lc]+=tag[p];
	tag[rc]+=tag[p],maxn[rc]+=tag[p];
	tag[p]=0;
}
V build(int p,int L,int R){
	if(L==R)return void(maxn[p]=-b[L].c);
	int mid=L+R>>1;
	build(lson),build(rson),update(p);
}
V init(){
	sort(a+1,a+1+n),sort(b+1,b+1+m),sort(c+1,c+1+k);
	build(root);
}
V add(int p,int L,int R,int l,int r,int x){
	if(L==l&&R==r)return maxn[p]+=x,tag[p]+=x,void();
	int mid=L+R>>1;solve(p);
	if(r<=mid)return add(lson,l,r,x),update(p);
	if(l>mid)return add(rson,l,r,x),update(p);
	add(lson,l,mid,x),add(rson,mid+1,r,x),update(p);
}
I find(int x){
	int l=1,r=m+1,mid;
	while(mid=l+r>>1,l^r)
		if(b[mid].v>x)
			r=mid;
		else l=mid+1;
	return mid;
}
V work(){
	int cur=0,p;
	b[m+1].v=INF;
	FOR(i,1,n){
		while(cur<k&&c[cur+1].a<a[i].v){
			cur++;
			p=find(c[cur].b);
			if(p<=m)
				add(root,p,m,c[cur].c);
		}
		ans=max(ans,maxn[1]-a[i].c);
	}
	cout<<ans;
}
int main(){
	input();
	init();
	work();
	return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma GCC optimize(2)
#pragma GCC optimize(3)

#include <bits/stdc++.h>

using namespace std;

inline int read() {
    int x = 0, neg = 1;
    char op = getchar();
    while (!isdigit(op)) {
        if (op == '-') neg = -1;
        op = getchar();
    }
    while (isdigit(op)) {
        x = 10 * x + op - '0';
        op = getchar();
    }
    return neg * x;
}

inline void print(int x) {
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    if (x >= 10) print(x / 10);
    putchar(x % 10 + '0');
}

const int N = 1000005;

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

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

int n, m, p;

const long long inf = 1e18;
int ff[N << 2];
struct SegmentTree {
#define ls (u << 1)
#define rs (u << 1 | 1)
    long long val[N << 2];
    int tag[N << 2];
    void pu(int u) {
        val[u] = max(val[ls], val[rs]);
    }
    void pushdown(int u) {
        if (tag[u]) {
            val[ls] += tag[u], tag[ls] += tag[u];
            val[rs] += tag[u], tag[rs] += tag[u];
            tag[u] = 0;
        }
    }
    void build(int u, int l, int r) {
        if (l == r) {
            if (!ff[l]) {
                val[u] = -inf;
            } else {
                val[u] = -ff[l];
            }
            return ;
        }
        int mid = l + r >> 1;
        build(ls, l, mid);
        build(rs, mid + 1, r);
        pu(u);
    }
    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return ;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return ;
        }
        pushdown(u);
        int mid=  l + r >> 1;
        if (ql <= mid) update(ls, l, mid, ql, qr, x);
        if (qr > mid) update(rs, mid + 1, r, ql, qr, x);
        pu(u);
    }
} smt;

int main() {
    int n, m, p;
    n = read();
    m = read();
    p = read();
    for (int i = 0; i < n; i++)a[i].x = read(), a[i].val = read();
    for (int i = 0; i < m; i++)b[i].x = read(), b[i].val = read();
    for (int i = 0; i < p; i++) c[i].x = read(), c[i].y = read(), c[i].z = read();
    sort(a, a + n);
    sort(b, b + m);
    sort(c, c + p);
    for (int i = 0; i < m; i++) {
        if (!ff[b[i].x] || b[i].val < ff[b[i].x]) {
            ff[b[i].x] = b[i].val;
        }
    }
    SegmentTree smt;
    smt.build(1, 1, 1000000);
    int pointerC = 0;
    long long ans = LLONG_MIN;
    for (int i = 0; i < n; i++) {
        while (pointerC < p && c[pointerC].x < a[i].x) {
            smt.update(1, 1, 1000000, c[pointerC].y + 1, 1000000,
                       c[pointerC].z);
            pointerC++;
        }
        ans = max(ans, smt.val[1] - a[i].val);
    }
    printf("%lld\n", ans);
    return 0;
}


// Author: wlzhouzhuan
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rint register int
#define rep(i, l, r) for (rint i = l; i <= r; i++)
#define per(i, l, r) for (rint i = l; i >= r; i--)
#define mset(s, _) memset(s, _, sizeof(s))
#define pb push_back
#define pii pair <int, int>
#define mp(a, b) make_pair(a, b)

#define int long long
inline int read() {
  int x = 0, neg = 1; char op = getchar();
  while (!isdigit(op)) { if (op == '-') neg = -1; op = getchar(); }
  while (isdigit(op)) { x = 10 * x + op - '0'; op = getchar(); }
  return neg * x;
}
inline void print(int x) {
  if (x < 0) { putchar('-'); x = -x; }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}

const int N = 1000005;

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

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

int n, m, p;

const ll inf = 1e18;
int ff[N << 2];
struct SegmentTree {
  #define ls (u << 1)
  #define rs (u << 1 | 1)
  long long val[N << 2];
  int tag[N << 2];
  void pu(int u) {
    val[u] = max(val[ls], val[rs]);
  }
  void pushdown(int u) {
    if (tag[u]) {
      val[ls] += tag[u], tag[ls] += tag[u];
      val[rs] += tag[u], tag[rs] += tag[u];
      tag[u] = 0;
    }
  }
  void build(int u, int l, int r) {
    if (l == r) {
      if (!ff[l]) {
        val[u] = -inf;
      } else {
        val[u] = -ff[l];
      }
      return ;
    }
    int mid = l + r >> 1;
    build(ls, l, mid);
    build(rs, mid + 1, r);
    pu(u);
  }
  void update(int u, int l, int r, int ql, int qr, int x) {
    if (l > r || ql > qr) {
      return ;
    }
    if (ql <= l && r <= qr) {
      tag[u] += x, val[u] += x;
      return ;
    }
    pushdown(u);
    int mid=  l + r >> 1;
    if (ql <= mid) update(ls, l, mid, ql, qr, x);
    if (qr > mid) update(rs, mid + 1, r, ql, qr, x);
    pu(u);
  }
} smt;

signed main() {
  scanf("%d%d%d", &n, &m, &p);
  for (int i = 1; i <= n; i++) {
    a[i].x = read();
    a[i].val = read();
  }
  for (int i = 1; i <= m; i++) {
    b[i].x = read();
    b[i].val = read();
  }
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  for (rint i = 1; i <= m; i++) {
    if (!ff[b[i].x] || b[i].val < ff[b[i].x]) {
      ff[b[i].x] = b[i].val;
    }
  }
  for (rint i = 1; i <= p; i++) {
    c[i].x = read();
    c[i].y = read();
    c[i].z = read();
  }
  sort(c + 1, c + p + 1);

  long long ans = -1e18;
  int cur = 0;
  smt.build(1, 1, 1e6);

  for (rint i = 1; i <= n; i++)  {
    while (cur < p && c[cur + 1].x < a[i].x) {
      cur++;
      smt.update(1, 1, 1e6, c[cur].y + 1, 1e6, c[cur].z);
    }
    ans = max(ans, smt.val[1] - a[i].val);
  }
  printf("%lld\n", ans);
  return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

int val[1000005 << 2];
int tag[1000005 << 2];

void build(int u, int l, int r, vector<int> &ff) {
    if (l == r) {
        if (!ff[l]) {
            val[u] = INT32_MIN;
        } else {
            val[u] = -ff[l];
        }
        return;
    }
    int mid = l + r >> 1;
    build(u << 1, l, mid, ff);
    build((u << 1 | 1), mid + 1, r, ff);
    val[u] = max(val[u << 1], val[(u << 1 | 1)]);
}

void update(int u, int l, int r, int ql, int qr, int x) {
    if (l > r || ql > qr) {
        return;
    }
    if (ql <= l && r <= qr) {
        tag[u] += x, val[u] += x;
        return;
    }

    if (tag[u]) {
        val[u << 1] += tag[u], tag[u << 1] += tag[u];
        val[(u << 1 | 1)] += tag[u], tag[(u << 1 | 1)] += tag[u];
        tag[u] = 0;
    }

    int mid = l + r >> 1;
    if (ql <= mid) update(u << 1, l, mid, ql, qr, x);
    if (qr > mid) update((u << 1 | 1), mid + 1, r, ql, qr, x);
    val[u] = max(val[u << 1], val[(u << 1 | 1)]);
}

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense(1000001);
        for (int i = 0; i < m; i++) {
            if (!tempDefense[defense[i].first] || defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }

        build(1, 1, 1000000, tempDefense);
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                update(1, 1, 1000000, monster[pointerC].second.first + 1, 1000000,
                       monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, val[1] - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

const int N = 1000005;
int t[N << 1];
int d[N];
const int h = sizeof(int) * 8 - __builtin_clz(N);

void apply(int p, int value) {
    t[p] += value;
    if (p < N) d[p] += value;
}

void build(int p) {
    while (p > 1) p >>= 1, t[p] = max(t[p << 1], t[p << 1 | 1]) + d[p];
}

void push(int p) {
    for (int s = h; s > 0; --s) {
        int i = p >> s;
        if (d[i] != 0) {
            apply(i << 1, d[i]);
            apply(i << 1 | 1, d[i]);
            d[i] = 0;
        }
    }
}

void inc(int l, int r, int value) {
    l += N, r += N;
    int l0 = l, r0 = r;
    for (; l < r; l >>= 1, r >>= 1) {
        if (l & 1) apply(l++, value);
        if (r & 1) apply(--r, value);
    }
    build(l0);
    build(r0 - 1);
}

int query(int l, int r) {
    l += N, r += N;
    push(l);
    push(r - 1);
    int res = -2e9;
    for (; l < r; l >>= 1, r >>= 1) {
        if (l & 1) res = max(res, t[l++]);
        if (r & 1) res = max(t[--r], res);
    }
    return res;
}

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense(1000005, 2e9);
        for (int i = 0; i < m; i++) {
            if (defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }
        for (int i = 0; i < 1000005; i++) inc(i, i + 1, -tempDefense[i]);
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                inc(monster[pointerC].second.first + 1, 1000000 + 1,
                    monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, query(0, 1000001) - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

struct SegmentTree {
public:
    int val[1000005 << 2];
    int tag[1000005 << 2];

    void pu(int u) {
        val[u] = max(val[u << 1], val[(u << 1 | 1)]);
    }

    void pushdown(int u) {
        if (tag[u]) {
            val[u << 1] += tag[u], tag[u << 1] += tag[u];
            val[(u << 1 | 1)] += tag[u], tag[(u << 1 | 1)] += tag[u];
            tag[u] = 0;
        }
    }

    void build(int u, int l, int r, vector<int> &ff) {
        if (l == r) {
            if (!ff[l]) {
                val[u] = INT32_MIN;
            } else {
                val[u] = -ff[l];
            }
            return;
        }
        int mid = l + r >> 1;
        build(u << 1, l, mid, ff);
        build((u << 1 | 1), mid + 1, r, ff);
        pu(u);
    }

    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return;
        }
        pushdown(u);
        int mid = l + r >> 1;
        if (ql <= mid) update(u << 1, l, mid, ql, qr, x);
        if (qr > mid) update((u << 1 | 1), mid + 1, r, ql, qr, x);
        pu(u);
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense(1000001);
        for (int i = 0; i < m; i++) {
            if (!tempDefense[defense[i].first] || defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }
        SegmentTree smt;
        smt.build(1, 1, 1000000, tempDefense);
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                smt.update(1, 1, 1000000, monster[pointerC].second.first + 1, 1000000,
                           monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, smt.val[1] - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma GCC optimize(2)
#pragma GCC optimize(3)

#include <bits/stdc++.h>

using namespace std;

inline int read() {
    int x = 0, neg = 1;
    char op = getchar();
    while (!isdigit(op)) {
        if (op == '-') neg = -1;
        op = getchar();
    }
    while (isdigit(op)) {
        x = 10 * x + op - '0';
        op = getchar();
    }
    return neg * x;
}

inline void print(int x) {
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    if (x >= 10) print(x / 10);
    putchar(x % 10 + '0');
}

const int N = 1000005;

struct ele {
    int x, val;

    friend bool operator<(const ele &a, const ele &b) {
        return a.x < b.x;
    }
} a[N], b[N];

struct pp {
    int x, y, z;

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

int n, m, p;

const long long inf = 1e18;
int ff[N << 2];

struct SegmentTree {
#define ls (u << 1)
#define rs (u << 1 | 1)
    long long val[N << 2];
    int tag[N << 2];

    void pu(int u) {
        val[u] = max(val[ls], val[rs]);
    }

    void pushdown(int u) {
        if (tag[u]) {
            val[ls] += tag[u], tag[ls] += tag[u];
            val[rs] += tag[u], tag[rs] += tag[u];
            tag[u] = 0;
        }
    }

    void build(int u, int l, int r) {
        if (l == r) {
            if (!ff[l]) {
                val[u] = -inf;
            } else {
                val[u] = -ff[l];
            }
            return;
        }
        int mid = l + r >> 1;
        build(ls, l, mid);
        build(rs, mid + 1, r);
        pu(u);
    }

    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return;
        }
        pushdown(u);
        int mid = l + r >> 1;
        if (ql <= mid) update(ls, l, mid, ql, qr, x);
        if (qr > mid) update(rs, mid + 1, r, ql, qr, x);
        pu(u);
    }
} smt;

signed main() {
    n = read();
    m = read();
    p = read();
    for (int i = 0; i < n; i++) {
        a[i].x = read();
        a[i].val = read();
    }
    for (int i = 0; i < m; i++) {
        b[i].x = read();
        b[i].val = read();
    }
    for (int i = 0; i < p; i++) {
        c[i].x = read();
        c[i].y = read();
        c[i].z = read();
    }
    sort(a, a + n);
    sort(b, b + m);
    sort(c, c + p);
    for (int i = 0; i < m; i++) {
        if (!ff[b[i].x] || b[i].val < ff[b[i].x]) {
            ff[b[i].x] = b[i].val;
        }
    }
    long long ans = -1e18;
    int pointerC = 0;
    smt.build(1, 1, 1000000);
    for (int i = 0; i < n; i++) {
        while (pointerC < p && c[pointerC].x < a[i].x) {
            smt.update(1, 1, 1000000, c[pointerC].y + 1, 1000000,
                       c[pointerC].z);
            pointerC++;
        }
        ans = max(ans, smt.val[1] - a[i].val);
    }
    printf("%lld\n", ans);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

class CWorldOfDarkraftBattleForAzathoth {
public:
    struct Node {
        Node *l = 0, *r = 0;
        int lo, hi;
        long long madd = 0, val = -1e18;

        Node(vector<int> &v, int lo, int hi) : lo(lo), hi(hi) {
            if (lo + 1 < hi) {
                int mid = lo + (hi - lo) / 2;
                l = new Node(v, lo, mid);
                r = new Node(v, mid, hi);
                val = max(l->val, r->val);
            } else val = -v[lo];
        }

        long long query(int L, int R) {
            if (R <= lo || hi <= L) return -1e18;
            if (L <= lo && hi <= R) return val;
            push();
            return max(l->query(L, R), r->query(L, R));
        }

        void add(int L, int R, long long x) {
            if (R <= lo || hi <= L) return;
            if (L <= lo && hi <= R) {
                madd += x;
                val += x;
            } else {
                push(), l->add(L, R, x), r->add(L, R, x);
                val = max(l->val, r->val);
            }
        }

        void push() {
            if (madd)
                l->add(lo, hi, madd), r->add(lo, hi, madd), madd = 0;
        }
    };

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense;
        for (int i = 0; i < m; i++) tempDefense.push_back(defense[i].second);
        Node nd(tempDefense, 0, m);
        int pointerC = 0;
        long long ans = LLONG_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                int index = upper_bound(defense.begin(), defense.end(),
                                        make_pair(monster[pointerC].second.first, (int) (1e9) + 1)) - defense.begin();
                nd.add(index, m, monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, nd.query(0, m) - attack[i].second);
        }
        out << ans << "\n";
    }
};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

struct SegmentTree {
public:
    long long val[1000005 << 2];
    int tag[1000005 << 2];

    void pu(int u) {
        val[u] = max(val[u << 1], val[(u << 1 | 1)]);
    }

    void pushdown(int u) {
        if (tag[u]) {
            val[u << 1] += tag[u], tag[u << 1] += tag[u];
            val[(u << 1 | 1)] += tag[u], tag[(u << 1 | 1)] += tag[u];
            tag[u] = 0;
        }
    }

    void build(int u, int l, int r, vector<int> &ff) {
        if (l == r) {
            if (!ff[l]) {
                val[u] = -1e18;
            } else {
                val[u] = -ff[l];
            }
            return;
        }
        int mid = l + r >> 1;
        build(u << 1, l, mid, ff);
        build((u << 1 | 1), mid + 1, r, ff);
        pu(u);
    }

    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return;
        }
        pushdown(u);
        int mid = l + r >> 1;
        if (ql <= mid) update(u << 1, l, mid, ql, qr, x);
        if (qr > mid) update((u << 1 | 1), mid + 1, r, ql, qr, x);
        pu(u);
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense(1000001);
        for (int i = 0; i < m; i++) {
            if (!tempDefense[defense[i].first] || defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }
        SegmentTree smt;
        smt.build(1, 1, 1000000, tempDefense);
        int pointerC = 0;
        long long ans = LLONG_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                smt.update(1, 1, 1000000, monster[pointerC].second.first + 1, 1000000,
                           monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, smt.val[1] - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

#ifndef CM_SPARSETABLE_HPP
#define CM_SPARSETABLE_HPP

template<typename T, class F = std::function<T(const T &, const T &)>>
class SparseTable {
public:
    int n;
    std::vector<std::vector<T>> mat;
    F func;

    SparseTable(const std::vector<T> &a, const F &f) : func(f) {
        n = static_cast<int>(a.size());
        int max_log = 32 - __builtin_clz(n);
        mat.resize(max_log);
        mat[0] = a;
        for (int j = 1; j < max_log; j++) {
            mat[j].resize(n - (1 << j) + 1);
            for (int i = 0; i <= n - (1 << j); i++) {
                mat[j][i] = func(mat[j - 1][i], mat[j - 1][i + (1 << (j - 1))]);
            }
        }
    }

    T get(int from, int to) const {
        assert(0 <= from && from <= to && to <= n - 1);
        int lg = 32 - __builtin_clz(to - from + 1) - 1;
        return func(mat[lg][from], mat[lg][to - (1 << lg) + 1]);
    }
};

#endif //CM_SPARSETABLE_HPP

#ifndef CM_BST_HPP
#define CM_BST_HPP

template<class T, class T1>
class BST {
private:
    class Node {
    public :
        T data;
        Node *leftChild;
        Node *rightChild;
        T1 leftCount, rightCount, height, totalCount;

        Node(T data) {
            this->data = data;
            this->leftChild = NULL;
            this->rightChild = NULL;
            this->leftCount = 0;
            this->rightCount = 0;
            this->height = 1;
            this->totalCount = 1;
        }

        Node(T data, T1 totalCount) {
            this->data = data;
            this->leftChild = NULL;
            this->rightChild = NULL;
            this->leftCount = 0;
            this->rightCount = 0;
            this->height = 1;
            this->totalCount = totalCount;
        }
    };

    Node *rootNode;
    Node *temporaryNode1;
    Node *temporaryNode2;
    T1 treeSize;
    bool multiCount;

    T1 getDiff(Node *temp) {
        if (temp == NULL) return 0;
        return getheight(temp->leftChild) - getheight(temp->rightChild);
    }

    T1 getheight(Node *temp) {
        if (temp == NULL) return 0;
        return temp->height;
    }

    Node *rightRotate(Node *temp) {
        temporaryNode1 = temp->leftChild;
        temporaryNode2 = temporaryNode1->rightChild;
        temporaryNode1->rightChild = temp;
        temp->leftChild = temporaryNode2;
        //height updation
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        temporaryNode1->height =
                std::max(getheight(temporaryNode1->leftChild), getheight(temporaryNode1->rightChild)) + 1;
        //totalCount updation
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        if (temporaryNode1->leftChild != NULL)
            temporaryNode1->leftCount =
                    temporaryNode1->leftChild->leftCount + temporaryNode1->leftChild->rightCount +
                    temporaryNode1->leftChild->totalCount;
        else temporaryNode1->leftCount = 0;
        if (temporaryNode1->rightChild != NULL)
            temporaryNode1->rightCount =
                    temporaryNode1->rightChild->leftCount + temporaryNode1->rightChild->rightCount +
                    temporaryNode1->rightChild->totalCount;
        else temporaryNode1->rightCount = 0;
        return temporaryNode1;
    }

    Node *leftRotate(Node *temp) {
        temporaryNode1 = temp->rightChild;
        temporaryNode2 = temporaryNode1->leftChild;
        temporaryNode1->leftChild = temp;
        temp->rightChild = temporaryNode2;
        //height updation
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        temporaryNode1->height =
                std::max(getheight(temporaryNode1->leftChild), getheight(temporaryNode1->rightChild)) + 1;
        //totalCount updation
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        if (temporaryNode1->leftChild != NULL)
            temporaryNode1->leftCount =
                    temporaryNode1->leftChild->leftCount + temporaryNode1->leftChild->rightCount +
                    temporaryNode1->leftChild->totalCount;
        else temporaryNode1->leftCount = 0;
        if (temporaryNode1->rightChild != NULL)
            temporaryNode1->rightCount =
                    temporaryNode1->rightChild->leftCount + temporaryNode1->rightChild->rightCount +
                    temporaryNode1->rightChild->totalCount;
        else temporaryNode1->rightCount = 0;
        return temporaryNode1;
    }

    Node *remove(Node *temp, T &data, T1 totalCount) {
        if (temp == NULL) return temp;
        if (data < temp->data) temp->leftChild = remove(temp->leftChild, data, totalCount);
        else if (data > temp->data) temp->rightChild = remove(temp->rightChild, data, totalCount);
        else {
            if (multiCount && totalCount < temp->totalCount && temp->totalCount > 1) {
                treeSize -= totalCount;
                temp->totalCount -= totalCount;
            } else {
                treeSize -= temp->totalCount;
                if (temp->leftChild == NULL && temp->rightChild == NULL) return NULL;
                else if (temp->leftChild == NULL) return temp->rightChild;
                else if (temp->rightChild == NULL) return temp->leftChild;
                else {
                    temporaryNode1 = minValue(temp->rightChild);
                    temp->data = temporaryNode1->data;
                    temp->totalCount = temporaryNode1->totalCount;
                    temp->rightChild = remove(temp->rightChild, temporaryNode1->data, temporaryNode1->totalCount);
                    treeSize += temp->totalCount;
                }
            }
        }
        // for leftside and rightside count
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;

        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        //Balancing
        T1 diff = getDiff(temp);
        if (diff > 1) {
            if (getDiff(temp->leftChild) >= 0) {
                temp = rightRotate(temp);
            } else {
                temp->leftChild = leftRotate(temp->leftChild);
                temp = rightRotate(temp);
            }
        } else if (diff < -1) {
            if (getDiff(temp->rightChild) <= 0) {
                temp = leftRotate(temp);
            } else {
                temp->rightChild = rightRotate(temp->rightChild);
                temp = leftRotate(temp);
            }
        }
        return temp;
    }

    Node *minValue(Node *temp) {
        temporaryNode1 = temp;
        while (temporaryNode1->leftChild != NULL) temporaryNode1 = temporaryNode1->leftChild;
        return temporaryNode1;
    }

    Node *insert(Node *temp, T &data, T1 totalCount) {
        if (temp == NULL) {
            if (multiCount) {
                treeSize += totalCount;
                return new Node(data, totalCount);
            } else {
                treeSize++;
                return new Node(data);
            }
        }
        if (data < temp->data) temp->leftChild = insert(temp->leftChild, data, totalCount);
        else if (data > temp->data) temp->rightChild = insert(temp->rightChild, data, totalCount);
        else if (multiCount) {
            treeSize += totalCount;
            temp->totalCount += totalCount;
        }
        // for __leftside and rightCount totalCount
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        //Balancing
        T1 diff = getDiff(temp);
        if (diff > 1) {
            if (data < temp->leftChild->data) {
                temp = rightRotate(temp);
            } else if (data > temp->leftChild->data) {
                temp->leftChild = leftRotate(temp->leftChild);
                temp = rightRotate(temp);
            }
        } else if (diff < -1) {
            if (data > (temp->rightChild->data)) {
                temp = leftRotate(temp);
            } else if (data < temp->rightChild->data) {
                temp->rightChild = rightRotate(temp->rightChild);
                temp = leftRotate(temp);
            }
        }
        return temp;
    }

public :

    BST() {
        rootNode = NULL;
        treeSize = 0;
        multiCount = false;
    }

    BST(bool multiCount) {
        rootNode = NULL;
        treeSize = 0;
        this->multiCount = multiCount;
    }

    T1 lower_bound(T data) {
        temporaryNode1 = rootNode;
        T1 index = 0;
        while (temporaryNode1 != NULL) {
            if (data < temporaryNode1->data) {
                temporaryNode1 = temporaryNode1->leftChild;
            } else if (data > temporaryNode1->data) {
                index += (temporaryNode1->totalCount + temporaryNode1->leftCount);
                temporaryNode1 = temporaryNode1->rightChild;
            } else {
                index += (temporaryNode1->leftCount);
                break;
            }
        }
        return index;
    }

    T get(T1 index) {
        temporaryNode1 = rootNode;
        T1 current = 0;
        while (temporaryNode1 != NULL) {
            if (temporaryNode1->leftChild == NULL) {
                if (temporaryNode1->totalCount + current > index) return temporaryNode1->data;
                else {
                    current += temporaryNode1->totalCount;
                    temporaryNode1 = temporaryNode1->rightChild;
                }
            } else {
                if (current + temporaryNode1->leftCount > index) temporaryNode1 = temporaryNode1->leftChild;
                else if (current + temporaryNode1->leftCount + temporaryNode1->totalCount > index)
                    return temporaryNode1->data;
                else {
                    current += temporaryNode1->totalCount + temporaryNode1->leftCount;
                    temporaryNode1 = temporaryNode1->rightChild;
                }
            }
        }
        assert("Not possible");
    }

    void insert(T data, T1 totalCount = 1) {
        if (totalCount > 0) rootNode = insert(rootNode, data, totalCount);
    }

    void remove(T data, T1 totalCount = 1) {
        if (totalCount > 0) rootNode = remove(rootNode, data, totalCount);
    }

    T1 getCount(T data) {
        temporaryNode1 = rootNode;
        while (temporaryNode1 != NULL) {
            if (data < temporaryNode1->data) temporaryNode1 = temporaryNode1->leftChild;
            else if (data > temporaryNode1->data) temporaryNode1 = temporaryNode1->rightChild;
            else return temporaryNode1->totalCount;
        }
        return 0;
    }

    bool contains(T data) {
        temporaryNode1 = rootNode;
        while (temporaryNode1 != NULL) {
            if (data == temporaryNode1->data) return true;
            else if (data < temporaryNode1->data) temporaryNode1 = temporaryNode1->leftChild;
            else temporaryNode1 = temporaryNode1->rightChild;
        }
        return false;
    }

    T1 size() {
        return this->treeSize;
    }
};

#endif //CM_BST_HPP

using namespace std;

class CWorldOfDarkraftBattleForAzathoth {
public:
    vector<long long> BIT;

    void update(int x, long long delta) {
        for (; x <= 1000000; x += x & -x)
            BIT[x] += delta;
    }

    long long query(int x) {

        long long sum = 0;
        for (; x > 0; x -= x & -x)
            sum += BIT[x];
        return sum;
    }

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        BIT.resize(1000005, 0);
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(monster.begin(), monster.end());
        vector<long long> minD(1000005, LLONG_MAX / 10);
        BST<int, int> bst(false);
        for (int i = 0; i < m; i++) minD[defense[i].first] = min(minD[defense[i].first], (long long) defense[i].second);
        for (int i = 0; i < m; i++) bst.insert(defense[i].first);
        for (int i = 1000003; i >= 0; i--) {
            minD[i] = min(minD[i + 1], minD[i]);
        }
        int pointerC = 0;
        long long ans = LLONG_MIN;
        long long sumMax = 0;
        int minB = 1000001;
        int maxB = 0;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                update(monster[pointerC].second.first, monster[pointerC].second.second);
                minB = min(minB, monster[pointerC].second.first);
                maxB = max(maxB, monster[pointerC].second.first);
                pointerC++;
            }

            {
                int temp = -1;
                int index = bst.lower_bound(minB + 1);
                if (index != bst.size()) temp = bst.get(index);
                ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(minB);
                if (index != bst.size()) temp = bst.get(index);
                ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(minB - 1);
                if (index != bst.size()) temp = bst.get(index);
                ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(maxB + 1);
                if (index != bst.size()) temp = bst.get(index);
                ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(maxB);
                if (index != bst.size()) temp = bst.get(index);
                ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(maxB - 1);
                if (index != bst.size()) temp = bst.get(index);
                ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }
        }
        out << ans << "\n";
    }
};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

#ifndef CM_SPARSETABLE_HPP
#define CM_SPARSETABLE_HPP

template<typename T, class F = std::function<T(const T &, const T &)>>
class SparseTable {
public:
    int n;
    std::vector<std::vector<T>> mat;
    F func;

    SparseTable(const std::vector<T> &a, const F &f) : func(f) {
        n = static_cast<int>(a.size());
        int max_log = 32 - __builtin_clz(n);
        mat.resize(max_log);
        mat[0] = a;
        for (int j = 1; j < max_log; j++) {
            mat[j].resize(n - (1 << j) + 1);
            for (int i = 0; i <= n - (1 << j); i++) {
                mat[j][i] = func(mat[j - 1][i], mat[j - 1][i + (1 << (j - 1))]);
            }
        }
    }

    T get(int from, int to) const {
        assert(0 <= from && from <= to && to <= n - 1);
        int lg = 32 - __builtin_clz(to - from + 1) - 1;
        return func(mat[lg][from], mat[lg][to - (1 << lg) + 1]);
    }
};

#endif //CM_SPARSETABLE_HPP

#ifndef CM_BST_HPP
#define CM_BST_HPP

template<class T, class T1>
class BST {
private:
    class Node {
    public :
        T data;
        Node *leftChild;
        Node *rightChild;
        T1 leftCount, rightCount, height, totalCount;

        Node(T data) {
            this->data = data;
            this->leftChild = NULL;
            this->rightChild = NULL;
            this->leftCount = 0;
            this->rightCount = 0;
            this->height = 1;
            this->totalCount = 1;
        }

        Node(T data, T1 totalCount) {
            this->data = data;
            this->leftChild = NULL;
            this->rightChild = NULL;
            this->leftCount = 0;
            this->rightCount = 0;
            this->height = 1;
            this->totalCount = totalCount;
        }
    };

    Node *rootNode;
    Node *temporaryNode1;
    Node *temporaryNode2;
    T1 treeSize;
    bool multiCount;

    T1 getDiff(Node *temp) {
        if (temp == NULL) return 0;
        return getheight(temp->leftChild) - getheight(temp->rightChild);
    }

    T1 getheight(Node *temp) {
        if (temp == NULL) return 0;
        return temp->height;
    }

    Node *rightRotate(Node *temp) {
        temporaryNode1 = temp->leftChild;
        temporaryNode2 = temporaryNode1->rightChild;
        temporaryNode1->rightChild = temp;
        temp->leftChild = temporaryNode2;
        //height updation
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        temporaryNode1->height =
                std::max(getheight(temporaryNode1->leftChild), getheight(temporaryNode1->rightChild)) + 1;
        //totalCount updation
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        if (temporaryNode1->leftChild != NULL)
            temporaryNode1->leftCount =
                    temporaryNode1->leftChild->leftCount + temporaryNode1->leftChild->rightCount +
                    temporaryNode1->leftChild->totalCount;
        else temporaryNode1->leftCount = 0;
        if (temporaryNode1->rightChild != NULL)
            temporaryNode1->rightCount =
                    temporaryNode1->rightChild->leftCount + temporaryNode1->rightChild->rightCount +
                    temporaryNode1->rightChild->totalCount;
        else temporaryNode1->rightCount = 0;
        return temporaryNode1;
    }

    Node *leftRotate(Node *temp) {
        temporaryNode1 = temp->rightChild;
        temporaryNode2 = temporaryNode1->leftChild;
        temporaryNode1->leftChild = temp;
        temp->rightChild = temporaryNode2;
        //height updation
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        temporaryNode1->height =
                std::max(getheight(temporaryNode1->leftChild), getheight(temporaryNode1->rightChild)) + 1;
        //totalCount updation
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        if (temporaryNode1->leftChild != NULL)
            temporaryNode1->leftCount =
                    temporaryNode1->leftChild->leftCount + temporaryNode1->leftChild->rightCount +
                    temporaryNode1->leftChild->totalCount;
        else temporaryNode1->leftCount = 0;
        if (temporaryNode1->rightChild != NULL)
            temporaryNode1->rightCount =
                    temporaryNode1->rightChild->leftCount + temporaryNode1->rightChild->rightCount +
                    temporaryNode1->rightChild->totalCount;
        else temporaryNode1->rightCount = 0;
        return temporaryNode1;
    }

    Node *remove(Node *temp, T &data, T1 totalCount) {
        if (temp == NULL) return temp;
        if (data < temp->data) temp->leftChild = remove(temp->leftChild, data, totalCount);
        else if (data > temp->data) temp->rightChild = remove(temp->rightChild, data, totalCount);
        else {
            if (multiCount && totalCount < temp->totalCount && temp->totalCount > 1) {
                treeSize -= totalCount;
                temp->totalCount -= totalCount;
            } else {
                treeSize -= temp->totalCount;
                if (temp->leftChild == NULL && temp->rightChild == NULL) return NULL;
                else if (temp->leftChild == NULL) return temp->rightChild;
                else if (temp->rightChild == NULL) return temp->leftChild;
                else {
                    temporaryNode1 = minValue(temp->rightChild);
                    temp->data = temporaryNode1->data;
                    temp->totalCount = temporaryNode1->totalCount;
                    temp->rightChild = remove(temp->rightChild, temporaryNode1->data, temporaryNode1->totalCount);
                    treeSize += temp->totalCount;
                }
            }
        }
        // for leftside and rightside count
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;

        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        //Balancing
        T1 diff = getDiff(temp);
        if (diff > 1) {
            if (getDiff(temp->leftChild) >= 0) {
                temp = rightRotate(temp);
            } else {
                temp->leftChild = leftRotate(temp->leftChild);
                temp = rightRotate(temp);
            }
        } else if (diff < -1) {
            if (getDiff(temp->rightChild) <= 0) {
                temp = leftRotate(temp);
            } else {
                temp->rightChild = rightRotate(temp->rightChild);
                temp = leftRotate(temp);
            }
        }
        return temp;
    }

    Node *minValue(Node *temp) {
        temporaryNode1 = temp;
        while (temporaryNode1->leftChild != NULL) temporaryNode1 = temporaryNode1->leftChild;
        return temporaryNode1;
    }

    Node *insert(Node *temp, T &data, T1 totalCount) {
        if (temp == NULL) {
            if (multiCount) {
                treeSize += totalCount;
                return new Node(data, totalCount);
            } else {
                treeSize++;
                return new Node(data);
            }
        }
        if (data < temp->data) temp->leftChild = insert(temp->leftChild, data, totalCount);
        else if (data > temp->data) temp->rightChild = insert(temp->rightChild, data, totalCount);
        else if (multiCount) {
            treeSize += totalCount;
            temp->totalCount += totalCount;
        }
        // for __leftside and rightCount totalCount
        if (temp->leftChild != NULL)
            temp->leftCount = temp->leftChild->leftCount + temp->leftChild->rightCount + temp->leftChild->totalCount;
        else temp->leftCount = 0;
        if (temp->rightChild != NULL)
            temp->rightCount =
                    temp->rightChild->leftCount + temp->rightChild->rightCount + temp->rightChild->totalCount;
        else temp->rightCount = 0;
        temp->height = std::max(getheight(temp->leftChild), getheight(temp->rightChild)) + 1;
        //Balancing
        T1 diff = getDiff(temp);
        if (diff > 1) {
            if (data < temp->leftChild->data) {
                temp = rightRotate(temp);
            } else if (data > temp->leftChild->data) {
                temp->leftChild = leftRotate(temp->leftChild);
                temp = rightRotate(temp);
            }
        } else if (diff < -1) {
            if (data > (temp->rightChild->data)) {
                temp = leftRotate(temp);
            } else if (data < temp->rightChild->data) {
                temp->rightChild = rightRotate(temp->rightChild);
                temp = leftRotate(temp);
            }
        }
        return temp;
    }

public :

    BST() {
        rootNode = NULL;
        treeSize = 0;
        multiCount = false;
    }

    BST(bool multiCount) {
        rootNode = NULL;
        treeSize = 0;
        this->multiCount = multiCount;
    }

    T1 lower_bound(T data) {
        temporaryNode1 = rootNode;
        T1 index = 0;
        while (temporaryNode1 != NULL) {
            if (data < temporaryNode1->data) {
                temporaryNode1 = temporaryNode1->leftChild;
            } else if (data > temporaryNode1->data) {
                index += (temporaryNode1->totalCount + temporaryNode1->leftCount);
                temporaryNode1 = temporaryNode1->rightChild;
            } else {
                index += (temporaryNode1->leftCount);
                break;
            }
        }
        return index;
    }

    T get(T1 index) {
        temporaryNode1 = rootNode;
        T1 current = 0;
        while (temporaryNode1 != NULL) {
            if (temporaryNode1->leftChild == NULL) {
                if (temporaryNode1->totalCount + current > index) return temporaryNode1->data;
                else {
                    current += temporaryNode1->totalCount;
                    temporaryNode1 = temporaryNode1->rightChild;
                }
            } else {
                if (current + temporaryNode1->leftCount > index) temporaryNode1 = temporaryNode1->leftChild;
                else if (current + temporaryNode1->leftCount + temporaryNode1->totalCount > index)
                    return temporaryNode1->data;
                else {
                    current += temporaryNode1->totalCount + temporaryNode1->leftCount;
                    temporaryNode1 = temporaryNode1->rightChild;
                }
            }
        }
        assert("Not possible");
    }

    void insert(T data, T1 totalCount = 1) {
        if (totalCount > 0) rootNode = insert(rootNode, data, totalCount);
    }

    void remove(T data, T1 totalCount = 1) {
        if (totalCount > 0) rootNode = remove(rootNode, data, totalCount);
    }

    T1 getCount(T data) {
        temporaryNode1 = rootNode;
        while (temporaryNode1 != NULL) {
            if (data < temporaryNode1->data) temporaryNode1 = temporaryNode1->leftChild;
            else if (data > temporaryNode1->data) temporaryNode1 = temporaryNode1->rightChild;
            else return temporaryNode1->totalCount;
        }
        return 0;
    }

    bool contains(T data) {
        temporaryNode1 = rootNode;
        while (temporaryNode1 != NULL) {
            if (data == temporaryNode1->data) return true;
            else if (data < temporaryNode1->data) temporaryNode1 = temporaryNode1->leftChild;
            else temporaryNode1 = temporaryNode1->rightChild;
        }
        return false;
    }

    T1 size() {
        return this->treeSize;
    }
};

#endif //CM_BST_HPP

using namespace std;

class CWorldOfDarkraftBattleForAzathoth {
public:
    vector<long long> BIT;

    void update(int x, long long delta) {
        for (; x <= 1000000; x += x & -x)
            BIT[x] += delta;
    }

    long long query(int x) {

        long long sum = 0;
        for (; x > 0; x -= x & -x)
            sum += BIT[x];
        return sum;
    }

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        BIT.resize(1000005, 0);
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(monster.begin(), monster.end());
        vector<long long> minD(1000005, LLONG_MAX / 10);
        BST<int, int> bst(false);
        for (int i = 0; i < m; i++) minD[defense[i].first] = min(minD[defense[i].first], (long long) defense[i].second);
        for (int i = 0; i < m; i++) bst.insert(defense[i].first);
        for (int i = 1000003; i >= 0; i--) {
            minD[i] = min(minD[i + 1], minD[i]);
        }
        int pointerC = 0;
        long long ans = LLONG_MIN;
        long long sumMax = 0;
        int minB = 1000001;
        int maxB = 0;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                update(monster[pointerC].second.first, monster[pointerC].second.second);
                minB = min(minB, monster[pointerC].second.first);
                maxB = max(maxB, monster[pointerC].second.first);
                pointerC++;
            }

            {
                int temp = -1;
                int index = bst.lower_bound(minB + 1);
                if (index != bst.size()) temp = bst.get(index);
                if (temp != -1)ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(minB);
                if (index != bst.size()) temp = bst.get(index);
                if (temp != -1)ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(minB - 1);
                if (index != bst.size()) temp = bst.get(index);
                if (temp != -1)ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(maxB + 1);
                if (index != bst.size()) temp = bst.get(index);
                if (temp != -1)ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(maxB);
                if (index != bst.size()) temp = bst.get(index);
                if (temp != -1) ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }

            {
                int temp = -1;
                int index = bst.lower_bound(maxB - 1);
                if (index != bst.size()) temp = bst.get(index);
                if (temp != -1) ans = max(ans, 0ll - attack[i].second - minD[temp] + query(temp - 1));
            }
            ans = max(ans, 0ll - attack[i].second - minD[0]);
        }
        out << ans << "\n";
    }
};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

template<typename T>
struct Array {
    T *ar;
    int n;

    Array() {
        ar = NULL;
        n = 0;
    }

    Array(int n, T m = 0) {
        this->n = n;
        ar = new T[n];
        for (int i = 0; i < n; i++) ar[i] = m;
    }

    T &operator[](int index) {
        assert(index < n);
        return ar[index];
    }

};

using namespace std;

struct segment {
    int N;
    Array<int> t;
    Array<int> d;
    int h;

    segment(int N, vector<int> &b) {
        this->N = N;
        t = Array<int>(N << 1);
        d = Array<int>(N);
        h = sizeof(int) * 8 - __builtin_clz(N);
        for (int i = 0; i < N; i++) t[i + N] = -b[i];
        build1();
    }

    void apply(int p, int value) {
        t[p] += value;
        if (p < N) d[p] += value;
    }

    void build1() {
        for (int i = N - 1; i > 0; --i) t[i] = max(t[i << 1], t[i << 1 | 1]);
    }

    void build(int p) {
        while (p > 1) p >>= 1, t[p] = max(t[p << 1], t[p << 1 | 1]) + d[p];
    }

    void push(int p) {
        for (int s = h; s > 0; --s) {
            int i = p >> s;
            if (d[i] != 0) {
                apply(i << 1, d[i]);
                apply(i << 1 | 1, d[i]);
                d[i] = 0;
            }
        }
    }

    void inc(int l, int r, int value) {
        l += N, r += N;
        int l0 = l, r0 = r;
        for (; l < r; l >>= 1, r >>= 1) {
            if (l & 1) apply(l++, value);
            if (r & 1) apply(--r, value);
        }
        build(l0);
        build(r0 - 1);
    }

    int query(int l, int r) {
        l += N, r += N;
        push(l);
        push(r - 1);
        int res = -2e9;
        for (; l < r; l >>= 1, r >>= 1) {
            if (l & 1) res = max(res, t[l++]);
            if (r & 1) res = max(t[--r], res);
        }
        return res;
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> b(1000005, 2e9);
        for (int i = 0; i < m; i++) {
            if (defense[i].second < b[defense[i].first]) {
                b[defense[i].first] = defense[i].second;
            }
        }
        segment st(1000005, b);
        int pointerC = 0;
        int ans = INT32_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                st.inc(monster[pointerC].second.first + 1, 1000000 + 1,
                       monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, st.query(0, 1000001) - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


/**
 * @author khokharnikunj8
 */

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

using namespace std;

class SegmentTree {
public:
    vector<long long> val;
    vector<int> tag;

    SegmentTree() {
        val.resize(1000005 << 2, 0);
        tag.resize(1000005 << 2, 0);
    }

    void pu(int u) {
        val[u] = max(val[u << 1], val[(u << 1 | 1)]);
    }

    void pushdown(int u) {
        if (tag[u]) {
            val[u << 1] += tag[u], tag[u << 1] += tag[u];
            val[(u << 1 | 1)] += tag[u], tag[(u << 1 | 1)] += tag[u];
            tag[u] = 0;
        }
    }

    void build(int u, int l, int r, vector<int> &ff) {
        if (l == r) {
            if (!ff[l]) {
                val[u] = -1e18;
            } else {
                val[u] = -ff[l];
            }
            return;
        }
        int mid = l + r >> 1;
        build(u << 1, l, mid, ff);
        build((u << 1 | 1), mid + 1, r, ff);
        pu(u);
    }

    void update(int u, int l, int r, int ql, int qr, int x) {
        if (l > r || ql > qr) {
            return;
        }
        if (ql <= l && r <= qr) {
            tag[u] += x, val[u] += x;
            return;
        }
        pushdown(u);
        int mid = l + r >> 1;
        if (ql <= mid) update(u << 1, l, mid, ql, qr, x);
        if (qr > mid) update((u << 1 | 1), mid + 1, r, ql, qr, x);
        pu(u);
    }
};

class CWorldOfDarkraftBattleForAzathoth {
public:

    void solve(std::istream &in, std::ostream &out) {
        int n, m, p;
        in >> n >> m >> p;
        vector<pair<int, int>> attack(n, {-1, -1});
        vector<pair<int, int>> defense(m, {-1, -1});
        vector<pair<int, pair<int, int>>> monster(p, {-1, {-1, -1}});
        for (int i = 0; i < n; i++) in >> attack[i].first >> attack[i].second;
        for (int i = 0; i < m; i++) in >> defense[i].first >> defense[i].second;
        for (int i = 0; i < p; i++) in >> monster[i].first >> monster[i].second.first >> monster[i].second.second;
        sort(attack.begin(), attack.end());
        sort(defense.begin(), defense.end());
        sort(monster.begin(), monster.end());
        vector<int> tempDefense(1000001);
        for (int i = 0; i < m; i++) {
            if (!tempDefense[defense[i].first] || defense[i].second < tempDefense[defense[i].first]) {
                tempDefense[defense[i].first] = defense[i].second;
            }
        }
        SegmentTree smt;
        smt.build(1, 1, 1000000, tempDefense);
        int pointerC = 0;
        long long ans = LLONG_MIN;
        for (int i = 0; i < n; i++) {
            while (pointerC < p && monster[pointerC].first < attack[i].first) {
                smt.update(1, 1, 1000000, monster[pointerC].second.first + 1, 1000000,
                           monster[pointerC].second.second);
                pointerC++;
            }
            ans = max(ans, smt.val[1] - attack[i].second);
        }
        out << ans << "\n";
    }

};

int main() {
    CWorldOfDarkraftBattleForAzathoth solver;
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}