#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <climits>
#include <deque>

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
double EPS=1e-10;
double EQ(double a,double b){
    return abs(a-b)<EPS;
}
void fast_stream(){
  std::ios_base::sync_with_stdio(0);
}
template<class T>
string IntToString(T num){
  string res;stringstream ss;ss<<num;
  return ss.str();
}
ll StringToInt(string &str){
  ll res=0;
  for(int i=0;i<(int)str.size();i++)
    res=(res*10+str[i]-'0');
  return res;
}

int sx,sy,gx,gy;
int n;
int xs[1001];
int ys[1001];
const int dy[2][6]={{1,0,-1,-1,-1,0},{1,1,0,-1,0,1}};
const int dx[2][6]={{0,1,1,0,-1,-1},{0,1,1,0,-1,-1}};
map<pii,int> d[6];
int lx,ly;
set<pii> obj;

int main(){
  cin>>sx>>sy>>gx>>gy;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>xs[i]>>ys[i];
    obj.insert(pii(ys[i],xs[i]));
  }
  cin>>lx>>ly;
  priority_queue<pair<int,pair<pii,int> >,vector<pair<int,pair<pii,int> > >,greater<pair<int,pair<pii,int> > > > pq;
  pq.push(make_pair(0,make_pair(pii(sy,sx),0)));
  d[0][pii(sy,sx)]=0;
  while(pq.size()){
    pair<int,pair<pii,int> > p=pq.top();pq.pop();
    int ccost=p.first;
    int cy=p.second.first.first;
    int cx=p.second.first.second;
    int dig=abs(cx)%2;
    int t=p.second.second%6;
    //cout<<cy<<" "<<cx<<" "<<ccost<<endl;
    for(int j=0;j<6;j++){
      int inst=abs((ll)cy*cx*(t+j))%6;
      int add=j;
      for(int i=0;i<6;i++){
	int ncost=ccost+(inst!=i)+add;
	int ny=cy+dy[dig][i];
	int nx=cx+dx[dig][i];
	pii np=pii(ny,nx);
	if(ny>=-ly&&nx>=-lx&&ny<=ly&&nx<=lx
	   &&obj.count(np)==0
	   &&(d[(t+j)%6].count(np)==0||d[(t+j)%6][np]>ncost)){
	  d[(t+j)%6][np]=ncost;
	  pq.push(make_pair(ncost,make_pair(np,(t+1+j)%6)));
	}
      }
    }
  }
  int res=1<<30;
  for(int i=0;i<6;i++)
    if(d[i].count(pii(gy,gx))>0)
      res=min(res,d[i][pii(gy,gx)]);
  if(res==(1<<30))res=-1;
  cout<<res<<endl;
  return 0;
}


  