#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int N;
map<i_i, bool> mp;
set<i_i> exist;
vector<vector<i_i>> serpents[25];
int dx[6] = {0, 1, 1, 0, -1, -1};
int dy[6] = {-1, -1, 0, 1, 1, 0};
int X, Y;
set<vector<i_i>> used;

bool valid(vector<i_i> &now) {
    exist.clear();
    for(int i = 0; i < now.size(); i++) {
        if(mp[now[i]]) return false;
        if(exist.find(now[i]) != exist.end()) return false;
        exist.insert(now[i]);
    }
    for(int i = 2; i < now.size(); i++) {
        for(int j = 0; j < 6; j++) {
            if(now[i].first == now[i-2].first + dx[j] && now[i].second == now[i-2].second + dy[j]) return false;
        }
    }
    return true;
}

bool connected(vector<i_i> &now) {
    for(int i = 1; i < now.size(); i++) {
        bool nowok = false;
        for(int j = 0; j < 6; j++) {
            if(now[i].first == now[i-1].first + dx[j] && now[i].second == now[i-1].second + dy[j]) nowok = true;
        }
        if(!nowok) return false;
    }
    return true;
}

void add(int T, vector<i_i> &serpent, int index) {
    if(!connected(serpent)) return;
    if(index >= serpent.size()) {
        if(valid(serpent)) {
            if(used.find(serpent) == used.end()) {
                serpents[T].push_back(serpent);
                used.insert(serpent);
            }
        }
        return;
    }
    for(int i = 0; i < 6; i++) {
        serpent[index].first += dx[i];
        serpent[index].second += dy[i];
        add(T, serpent, index + 2);
        serpent[index].first -= dx[i];
        serpent[index].second -= dy[i];
    }
    add(T, serpent, index + 1);
}

int main() {
    //cout.precision(10);
    while(true) {
        used.clear();
        cin >> N;
        if(N == 0) break;
        mp.clear();
        vector<i_i> initial(N);
        for(int i = 0; i <= 20; i++) serpents[i].clear();
        for(int i = 0; i < N; i++) {
            cin >> initial[i].first >> initial[i].second;
        }
        serpents[0].push_back(initial);
        int k;
        cin >> k;
        while(k--) {
            int u, v;
            cin >> u >> v;
            mp[{u, v}] = true;
        }
        cin >> X >> Y;
        //cout << valid(initial) << endl;
        bool cleared = false;
        for(int T = 0; T <= 20; T++) {
            if(cleared) break;
            //cerr << "T: " << T << endl;
            for(int i = 0; i < serpents[T].size(); i++) {
                vector<i_i> serpent = serpents[T][i];
                if(abs(X - serpent[0].first) + abs(Y - serpent[0].second) > 2 * (20 - T)) continue;
                /*
                cerr << T << ": ";
                for(int j = 0; j < serpent.size(); j++) {
                    cerr << "{" << serpent[j].first << ", " << serpent[j].second << "}, ";
                }
                cerr << endl;
                */
                if(serpent[0].first == X && serpent[0].second == Y) {
                    cout << T << endl;
                    cleared = true;
                    break;
                }
                add(T + 1, serpent, 0);
            }
        }
    }
    return 0;
}


Measured memory_bytes: 30532