#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <climits>
using namespace std;

#define REP(i,a,n) for(i=a; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define foreach(it,x) for(typeof(x.begin()) it=x.begin(); it!=x.end(); it++)

const int dx[] = {0,1,1,0,-1,-1};
const int dy[] = {-1,-1,0,1,1,0};
int N,K, goalX,goalY;
int res;
vector<pair<int,int> > snake_init;
map<vector<pair<int,int> >, int> dp;
set<vector<pair<int,int> > > used;
set<pair<int,int> > stone;

// {{{ input() //
void input(){
    int i,j,k;

    rep(i,N){
        int x,y; cin >> x >> y;
        snake_init.push_back(make_pair(x,y));
    }
    // stone
    cin >> K;
    rep(i,K){
        int u,v; cin >> u >> v;
        stone.insert(make_pair(u,v));
    }
    cin >> goalX >> goalY;
}
// }}} //


bool ccc(int idx, const vector<pair<int,int> >& buf){
    int i,j,k;
    int res = 0;

    if( stone.count(buf[idx]) ) return false;
    if( idx == 0 || idx == buf.size()-1 ) res = 1;

    rep(i,idx) if( buf[i] == buf[idx] ) return false;

    rep(k,6){
        int tx = buf[idx].first + dx[k];
        int ty = buf[idx].second + dy[k];
        if( idx != 0 ){
            if( buf[idx-1].first == tx && buf[idx-1].second == ty ) res++;
        }
        if( idx != N-1 ){
            if( buf[idx+1].first == tx && buf[idx+1].second == ty ) res++;
        }
        rep(i,idx-1){
            if( buf[i].first == tx && buf[i].second == ty ) return false;
        }
    }
    return res == 2;
}


// {{{ dfs //

void dfs(int idx, bool f, int cost, queue<vector<pair<int,int> > >& q, vector<pair<int,int> >& buf){
    int i,j,k;

    if( idx > 0 && ( 20 < cost + 2*max(abs(buf[0].first-goalX), abs(buf[0].second-goalY))-1 ) ) return ;

    if( idx == N ){
        if( dp.count(buf) == 0 ){
            dp[buf] = cost + 1;
            q.push(buf);
            if( buf[0].first == goalX && buf[0].second == goalY ){
                res = cost + 1;
            }
        }
        return;
    }

    if( ccc(idx, buf) ) dfs(idx+1, true, cost, q, buf);

    int go = 0;
    if( idx == 0 || f ){
        rep(k,6){
            buf[idx].first += dx[k]; buf[idx].second += dy[k];
            if( ccc(idx, buf) ){
                dfs(idx+1, false, cost, q, buf);
                go++;
            }
            buf[idx].first -= dx[k]; buf[idx].second -= dy[k];
            if( res != INT_MAX ) return;
            if( (!(idx == 0 || idx == N-1) && go) ||
                ((idx == 0 || idx == N-1) && go>=2) ) break;
        }
    }
}

// }}} //



void bfs(){
    int i,j,u,v,k;

    queue<vector<pair<int,int> > > q;
    q.push(snake_init);
    dp[snake_init] = 0;

    while( !q.empty() ){
        vector<pair<int,int> >& tmpv = q.front();
        int cost = dp[tmpv];

        if( cost > 20 || res != INT_MAX ) break;

        if( used.count(tmpv) ) continue;
        used.insert(tmpv);

        dfs(0,true,cost,q,tmpv);
        q.pop();
    }
}




int main(){

    while( cin >> N, N ){
        // init
        res = INT_MAX;
        snake_init.clear();
        stone.clear();
        used.clear();
        dp.clear();

        input();
        
        bfs();
        cout << res << endl;
    }

    return 0;
}

Measured memory_bytes: 0