#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
#define LL %I64d
#else
#define LL %ldd
#endif
using namespace std;

const long long MAX = 1e18;
const int N = 150003;

long long get(long long t[], int id, int l, int r, int u, int v) {
    if (u <= l && r <= v) return t[id];
    if (r < u || v < l) return MAX;
    int mid = (l + r) / 2;
    return min(get(t, id * 2, l, mid, u, v), get(t, id * 2 + 1, mid + 1, r, u, v));
}

void mod(long long t[], int id, int l, int r, int pos, long long val) {
    if (pos < l || pos > r) return;
    if (l == r) {
        t[id] = val;
        return;
    }
    int mid = (l + r) / 2;
    mod(t, id * 2, l, mid, pos, val);
    mod(t, id * 2 + 1, mid + 1, r, pos, val);
    t[id] = min(t[id * 2], t[id * 2 + 1]);
}

long long dp[4][N * 4], tmp[N];
vector<int> ls[4][N];
vector<long long> a[4];
int n[4];

long long Solve() {
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i < n[0]; ++i) {
        mod(dp[0], 1, 0, n[0] - 1, i, a[0][i]);
    }
    for (int i = 1; i < 4; ++i) {
        for (int j = 0; j < n[i]; ++j) {
            for (int k = 0; k < ls[i][j].size(); ++k) {
                int u = ls[i][j][k];
                tmp[u] = get(dp[i - 1], 1, 0, n[i - 1] - 1, u, u);
                mod(dp[i - 1], 1, 0, n[i - 1] - 1, u, MAX);
            }
            long long val = get(dp[i - 1], 1, 0, n[i - 1] - 1, 0, n[i - 1] - 1);
            mod(dp[i], 1, 0, n[i] - 1, j, val + a[i][j]);
            for (int k = 0; k < ls[i][j].size(); ++k) {
                int u = ls[i][j][k];
                mod(dp[i - 1], 1, 0, n[i - 1] - 1, u, tmp[u]);
            }
        }
    }
    long long tmp  =get(dp[3], 1, 0, n[3] - 1, 0, n[3] - 1);
    return (tmp < MAX ? tmp : -1);
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cin >> n[0] >> n[1] >> n[2] >> n[3];
    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j < n[i]; ++j) {
            long long x; cin >> x; a[i].push_back(x);
        }
    }
    for (int i = 1; i <= 3; ++i) {
        int m; cin >> m;
        for (int j = 0; j < m; ++j) {
            int x, y; cin >> x >> y;
            --x; --y;
            ls[i][y].push_back(x);
        }
    }
    cout << Solve() << '\n';
	return 0;
}
