////////////////////////////////////////
///  tu3 pro-con template            ///
////////////////////////////////////////
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
using namespace std;

//// MACRO ////
#define countof(a) (sizeof(a)/sizeof(a[0]))

#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i,n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define RFOR(i,s,n) for (int i = (n)-1; i >= (s); i--)
#define pos(c,i) c.being() + (i)
#define allof(c) c.begin(), c.end()
#define aallof(a) a, countof(a)
#define partof(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define apartof(a,i,n) a + (i), a + (i) + (n)
#define long long long

#define EPS 1e-9
#define INF (1L << 30)
#define LINF (1LL << 60)

//// i/o helper ////

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__
template <class T1, class T2> inline istream & operator >> (istream & in, pair<T1, T2> &p) { in >> p.first >> p.second; return in; }

struct _Writer
{
	bool f;
	_Writer() : f(false) { }
	template <class T> _Writer operator ,(const T &rhs) { cout << (f ? " " : "") << rhs; f = true; return *this; }
};
#define WRITE(...) _Writer(), __VA_ARGS__; cout << endl

//// i/o helper Ex ////

template <class T> class vevector : public vector<vector<T>> {
public: vevector(int n = 0, int m = 0, const T &initial = T()) : vector<vector<T>>(n, vector<T>(m, initial)) { }
};
template <class T> class vevevector : public vector<vevector<T>> {
public: vevevector(int n = 0, int m = 0, int l = 0, const T &initial = T()) : vector<vevector<T>>(n, vevector<T>(m, l, initial)) { }
};

template <class T> T read() { T t; cin >> t; return t; }
template <class T> vector<T> read(int n) { vector<T> v; REP(i, n) { v.push_back(read<T>()); } return v; }


//// start up ////
void solve();
int main()
{
	solve();
	return 0;
}

//// algorithm ////
// 範囲内チェック
inline bool contains(int x, int y, int W, int H) { return x >= 0 && x < W && y >= 0 && y < H; }

////////////////////
/// template end ///
////////////////////

void solve()
{
	int testcases = 1;
	REP(testcase, testcases)
	{
		READ(int, sx, sy, gx, gy, n);
		auto furnitures = read<pair<int,int>>(n);
		READ(int, lx, ly);

		int W = lx * 2 + 1, H = ly * 2 + 1;
		vevector<bool> field(W, H);
		sx += lx; sy += ly;
		gx += lx; gy += ly;
		for (auto f : furnitures) { field[f.first + lx][f.second + ly] = true; }

		// field ok.

		struct R { int x, y, c, t; bool operator > (const R&r) const { return c > r.c; } };
		priority_queue<R, vector<R>, greater<R>> q;
		q.push({ sx, sy, 0, 0, });

		int result = -1;
		vevevector<int> visited(W, H, 6, INF);
		int dx[2][7] = { { 0, 1, 1, 0, -1, -1, 0 }, { 0, 1, 1, 0, -1, -1, 0 } };
		int dy[2][7] = { { 1, 0, -1, -1, -1, 0, 0 }, { 1, 1, 0, -1, 0, 1, 0 }, };
		while (!q.empty())
		{
			R r = q.top(); q.pop();
			if (r.c > visited[r.x][r.y][r.t]) continue;
			if (r.x == gx && r.y == gy) { result = r.c; break; }

			REP(i, 7)
			{
				int nx = r.x + dx[r.x - lx & 1][i];
				int ny = r.y + dy[r.x - lx & 1][i];

				if (!contains(nx, ny, W, H)) { continue; }
				if (field[nx][ny]) { continue; }

				int fop = abs((r.x - lx) * (r.y - ly) * r.t) % 6;
				int nc = r.c + (i != fop);
				int nt = (r.t + 1) % 6;

				if (visited[nx][ny][nt] > nc)
				{
					visited[nx][ny][nt] = nc;
					q.push({ nx, ny, nc, nt });
				}
			}
		}
		WRITE(result);
	}
}

Measured memory_bytes: 3636