#include <bits/stdc++.h>
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define endl '\n'

using namespace std;

using ll = long long;
using pii = pair<int, int>;
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3fLL;
const int MOD = 1000000007;
const int dx[] = { 0, 0, -1, 1, 1, -1,  1, -1};
const int dy[] = {-1, 1,  0, 0, 1, -1, -1,  1};

class SegTreeIterative{
private:
  typedef long long Node;
  Node neutral = INFLL;
  vector<Node> st;
  int n;
  inline Node join(Node a, Node b){
    return min(a, b);
  }
public:
  template <class MyIterator>
  SegTreeIterative(MyIterator begin, MyIterator end){
    int sz = end - begin;
    for (n = 1; n < sz; n <<= 1);
    st.assign(n << 1, neutral);
    for (int i = 0; i < sz; i++, begin++)
      st[i + n] = (*begin);
    for (int i = n - 1; i; i--){
      st[i] = join(st[(i << 1)], st[(i << 1) + 1]);
    }
  }
  //0-indexed
  void update(int i, Node x){
    st[i += n] = x;
    for (i >>= 1; i; i >>= 1)
      st[i] = join(st[i << 1], st[(i << 1) + 1]);
  }
  //0-indexed [l, r]
  Node query(int l, int r){
    Node ansL = neutral, ansR = neutral;
    for (l += n, r += n + 1; l < r; l >>= 1, r >>= 1){
      if (l & 1)
        ansL = join(ansL, st[l++]);
      if (r & 1)
        ansR = join(st[--r], ansR);
    }
    return join(ansL, ansR);
  }
};

const int MAXN = 150010;
ll dp[4][MAXN];
ll v[4][MAXN];
int n[4], m[3];
vector<int> adj[3][MAXN];

int main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL);

  for(int i=0; i<4; i++)
    cin >> n[i];
  for(int i=0; i<4; i++){
    for(int j=1; j<=n[i]; j++)
      cin >> v[i][j];
  }
  for(int i=0; i<3; i++){
    cin >> m[i];
    for(int j=1; j<=m[i]; j++){
      int a, b;
      cin >> a >> b;
      adj[i][a].push_back(b);
    }
    for(int j=1; j<=n[i]; j++){
      adj[i][j].push_back(0);
      adj[i][j].push_back(n[i+1] + 1);
      sort(all(adj[i][j]));
    }
  }
  for(int j=1; j<=n[3]; j++)
    dp[3][j] = v[3][j];
  for(int i=2; i>=0; i--){
    SegTreeIterative st(dp[i+1], dp[i+1] + n[i+1] + 1);
    for(int j=1; j<=n[i]; j++){
      ll ans = INFLL;
      for(int k=1; k<adj[i][j].size(); k++)
        ans = min(ans, v[i][j] + st.query(adj[i][j][k-1] + 1, adj[i][j][k] - 1));
      dp[i][j] = ans;
    }
  }
  ll ans = INFLL;
  for(int j=1; j<=n[0]; j++)
    ans = min(ans, dp[0][j]);
  if(ans == INFLL)
    ans = -1;
  cout << ans << endl;
  return 0;
}
