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

struct State {
  int x, y, t, w;
  bool operator < (const State &s) const {
    return w > s.w;
  }
};

const int MAXSIZE = 202;
const int INF = 1<<28;
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}};

int sx, sy, gx, gy, lx, ly;
int H, W;
int G[MAXSIZE][MAXSIZE];
int cost[MAXSIZE][MAXSIZE][6];

int dijkstra() {
  priority_queue<State> que;
  fill(cost[0][0], cost[MAXSIZE][0], INF);
  cost[sy][sx][0] = 0;
  que.push((State){sx, sy, 0, 0});
  while (que.size()) {
    const State s = que.top();
    que.pop();
    if (cost[s.y][s.x][s.t] < s.w) continue;
    if (s.x == gx && s.y == gy) return s.w;
    const int c = (abs(s.x-lx) % 6) * (abs(s.y-ly) % 6) % 6 * s.t % 6;
    for (int k = 0; k < 7; ++k) {
      const State t = {s.x + dx[k], s.y + dy[abs(s.x-lx)%2][k],
                       (s.t + 1) % 6, s.w + (c != k)};
      if (t.x < 0 || t.x >= W) continue;
      if (t.y < 0 || t.y >= H) continue;
      if (G[t.y][t.x]) continue;
      if (cost[t.y][t.x][t.t] <= t.w) continue;
      cost[t.y][t.x][t.t] = t.w;
      que.push(t);
    }
  }
  return -1;
}

int main() {
  while (cin >> sx >> sy >> gx >> gy) {
    int n;
    cin >> n;
    vector<int> x(n), y(n);
    for (int i = 0; i < n; ++i) {
      cin >> x[i] >> y[i];
    }
    memset(G, 0, sizeof(G));
    cin >> lx >> ly;
    H = 2 * ly + 1;
    W = 2 * lx + 1;
    sx += lx;
    sy += ly;
    gx += lx;
    gy += ly;
    for (int i = 0; i < n; ++i) {
      G[y[i]+ly][x[i]+lx] = true;
    }
    cout << dijkstra() << endl;
  }
  return 0;
}