#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

const int dx[7] = {  0,  1, 1, 0, -1,  -1,  0};

const int dy[2][7] = {
	{  1,  0, -1, -1, -1,  0,  0},
	{  1,  1,  0, -1,  0,  1,  0}
};

inline int cnv(int x) { return x + 150; }
inline bool in_range(int x, int mn, int mx) { return mn <= x && x < mx; }

int sx, sy, gx, gy, n, lx, ly;
bool board[300][300];

struct State {
	int x, y, t, ignore;
	bool operator > (const State& a) const { return ignore > a.ignore; }
};

int dst[300][300][7];

int djk() {
	memset(dst, -1, sizeof(dst));
	
	priority_queue< State, vector< State >, greater< State > > que;
	que.push(State{sx, sy, 0, 0});
	
	dst[cnv(sy)][cnv(sx)][0] = 0;
	
	while (!que.empty()) {
		State s = que.top(); que.pop();
		
		int x = s.x, y = s.y, t = s.t, ignore = s.ignore;
		
		if (dst[cnv(y)][cnv(x)][t] < ignore) continue;
		
		if (x == gx && y == gy) return ignore;
		
		int d = ((int)abs(x * y * t)) % 6;
		int nt = (t + 1) % 6;
		
		for_(dd,0,7) {
			int nx = x + dx[dd], ny = y + dy[abs(x) & 1][dd];
			
			bool flag = false;
			
			if (!in_range(nx, -lx, lx + 1) || !in_range(ny, -ly, ly + 1)) flag = true;
			
			if (!flag && board[cnv(ny)][cnv(nx)]) flag = true;
			
			int add = (d == dd) ? 0 : 1;
			
			if (d == dd && flag) {
				nx = x;
				ny = y;
				flag = false;
				add = 1;
			}
			
			if (!flag) {
				int& nx_dst = dst[cnv(ny)][cnv(nx)][nt];
				
				if (nx_dst == -1 || nx_dst > ignore + add) {
					nx_dst = ignore + add;
					que.push(State{nx, ny, nt, ignore + add});
				}
			}
		}
	}
	
	return -1;
}

int main() {
	cin >> sx >> sy >> gx >> gy;
	cin >> n;
	
	memset(board, 0, sizeof(board));
	
	for_(i,0,n) {
		int x, y;
		cin >> x >> y;
		board[cnv(y)][cnv(x)] = 1;
	}
	
	cin >> lx >> ly;
	
	cout << djk() << endl;
}