#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;

struct state{
	  int x,y;
	  int s;
	  int t;
	  int dir;
	  state(int xi, int yi, int score,int time){
			x = xi; y = yi; s = score; t = time;
			dir = abs((ll)xi*(ll)yi*(ll)time ) % 6 ;
	  }
	  bool operator > (const state& tgt) const {
			return s > tgt.s;
	  }
	  bool operator < (const state& tgt) const {
			return s < tgt.s;
	  }
	  bool operator == (const state& tgt) const {
			if(x == tgt.x and y == tgt.y)
				  return true;
			else
				  return false;
	  }
	  
};

const int dx[2][7] = {{ 0, 1, 1, 0,-1,-1, 0}, { 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}};
int sx,sy,gx,gy;
int lx,ly;
int n;
int used[300][300][6];
vvi board;

void dijk(){

	  state ini = state(sx,sy,0,0);
	  priority_queue<state,vector<state>,greater<state> > q;
	  q.push(ini);

	  state corr = state(0,0,0,0);
	  while(q.size()){
			corr = q.top();		q.pop();

			if(corr == state(gx,gy,0,0)) break; // ??´??????
			if(used[corr.y+150][corr.x+150][corr.t%6] != -1)  continue; // ??¢?´¢??????
//			cout << "    POP (" << corr.x << "," << corr.y << ") "<< corr.s << "s ," << corr.t << "t" << endl;

			used[corr.y+150][corr.x+150][corr.t%6] = 1; // ??¢?´¢??????

			for(int i=0; i<7; i++){
				  int tmp = (corr.x + 300) % 2;
				  int nx  = corr.x + dx[tmp][i];
				  int ny  = corr.y + dy[tmp][i];
				  if(abs(nx) > lx || abs(ny) > ly)  continue; // ?£????
				  if(board[ny+150][nx+150] == 1)	continue; // ??¶???
				  
				  int score = corr.s;
				  if(corr.dir != i) score += 1; // ???????????????????????´???
//				  cout << "      PUSH (" << nx << "," << ny << ") "<< score <<"s ," << corr.t+1 << "t" << endl;
				  state next = state(nx, ny, score, corr.t+1); 
				  if(used[ny+150][nx+150][next.t%6] != 1)
						q.push(next);
			}
	  }
	  if(corr == state(gx,gy,0,0)) // ??´??????
			cout << corr.s << endl;
	  else
			cout << -1 << endl;
}


int main(){

//	  cout << (-11)%4x << endl;
	  cin >> sx >> sy >> gx >> gy;
	  cin >> n;
	  board = vvi(300,vi(300,0));
	  memset(used,-1,sizeof(used));
	  for(int i=0; i<n; i++){
			int xi,yi; cin >> xi >> yi;
			board[yi+150][xi+150] = 1;
	  }
	  cin >> lx >> ly;
	  dijk();
	  
}