////////////////////////////////////////
///  tu3 pro-con template            ///
////////////////////////////////////////
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#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__
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

template <class T1, class T2> inline istream & operator >> (istream & in, pair<T1, T2> &p) { in >> p.first >> p.second; return in; }

//// 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;
}

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; }

		struct R { int x, y, c, t; };
		deque<R> q;
		q.push_front({ sx, sy, 0, 0, });

		int result = -1;
		vevevector<int> visited(W, H, 6, INF);
		int dx[7] = { 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.front(); q.pop_front();
			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[i];
				int ny = r.y + dy[r.x - lx & 1][i];
				int nc = r.c + (i != abs((r.x - lx) * (r.y - ly) * r.t) % 6);
				int nt = (r.t + 1) % 6;

				if (nx >= 0 && nx < W && ny >= 0 && ny < H && !field[nx][ny] && visited[nx][ny][nt] > nc)
				{
					visited[nx][ny][nt] = nc;
					if (nc > r.c) q.push_back({ nx, ny, nc, nt });
					else q.push_front({ nx, ny, nc, nt });
				}
			}
		}
		WRITE(result);
	}
}

Measured memory_bytes: 3372