#include <bits/stdc++.h>
#define print(x) for(auto i : x) { cout << i << " "; } cout << endl;

typedef long long ll;
typedef long double ld;

#define int ll
#define double ld

using namespace std;

typedef pair<int, int> pii;

const int SIZE = 150000;
const int INF = 2e9;

int n[4], a[4][SIZE], dp[4][SIZE];
map<int, set<int>> m[4];

signed main () {
    for(int i = 0; i < 4; i++) {
        cin >> n[i];
    }

    for(int i = 0; i < 4; i++) {
        for(int j = 0; j < n[i]; j++) {
            cin >> a[i][j];
        }
    }

    for(int i = 1; i < 4; i++) {
        int c;
        cin >> c;

        while(c--) {
            int x, y;
            cin >> x >> y;

            x--;
            y--;

            m[i][y].insert(x);
        }
    }

    for(int i = 0; i < n[0]; i++) {
        dp[0][i] = a[0][i];
    }

    for(int i = 1; i < 4; i++) {
        set<pii> prev;

        for(int j = 0; j < n[i - 1]; j++) {
            prev.insert({dp[i - 1][j], j});
        }

        vector<set<pii>::iterator> v(prev.size());
        for(auto it = prev.begin(); it != prev.end(); it++) {
            v[it->second] = it;
        }

        for(int j = 0; j < n[i]; j++) {
            vector<pii> erased;

            for(auto k : m[i][j]) {
                erased.push_back(*v[k]);
                prev.erase(v[k]);
            }

            if(prev.empty()) {
                dp[i][j] = INF;
            }
            else {
                dp[i][j] = prev.begin()->first;
                if(dp[i][j] != INF) {
                    dp[i][j] += a[i][j];
                }
            }

            for(auto k : erased) {
                auto it = prev.insert(k);
                v[it.first->second] = it.first;
            }
        }
    }

    int ans = *min_element(dp[3], dp[3] + n[3]);

    if(ans == INF) {
        cout << -1;
    }
    else {
        cout << ans;
    }

    return 0;
}
