#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;

struct state {
  ll x, y, d, c;
  bool operator<(const state &s) const {
    return c > s.c;
  }
};

ll dx[2][7] = { { +0, +1, +1, +0, -1, -1, +0 }, { +0, +1, +1, +0, -1, -1, +0 } };
ll dy[2][7] = { { +1, +0, -1, -1, -1, +0, +0 }, { +1, +1, +0, -1, +0, +1, +0 } };

int main(void) {
  ll SX, SY, GX, GY;
  cin >> SX >> SY >> GX >> GY;
  ll N;
  cin >> N;
  vector<pll> P(N);
  REP(i, 0, N) cin >> P[i].first >> P[i].second;
  ll LX, LY;
  cin >> LX >> LY;

  sort(P.begin(), P.end());

  const ll INF = 1LL << 50;
  vector<vector<vector<ll>>> dp(LX * 2 + 1, vector<vector<ll>>(LY * 2 + 1, vector<ll>(6, INF)));
  priority_queue<state> q;
  q.push((state) { SX, SY, 0, 0 });

  while(q.size()) {
    ll x = q.top().x, y = q.top().y, d = q.top().d, c = q.top().c;
    q.pop();

    if(dp[x + LX][y + LY][d] <= c) continue;
    dp[x + LX][y + LY][d] = c;

    ll op = abs(x * y * d) % 6;
    REP(i, 0, 7) {
      ll nx = x + dx[abs(x) % 2][i];
      ll ny = y + dy[abs(x) % 2][i];
      ll nd = (d + 1) % 6;
      ll nc = c + (i == op ? 0 : 1);
      if(-LX <= nx && nx <= LX && -LY <= ny && ny <= LY) {
        if(!binary_search(P.begin(), P.end(), pll(nx, ny))) {
          q.push((state) { nx, ny, nd, nc });
        }
      }
    }
  }

  ll ans = INF;
  REP(i, 0, 6) ans = min(ans, dp[GX + LX][GY + LY][i]);
  cout << (ans < INF ? ans : -1) << endl;
}
