import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;

void main() {
    auto s = readln.split.map!(to!int);
    auto sx = s[0];
    auto sy = s[1];
    auto gx = s[2];
    auto gy = s[3];

    auto n = readln.chomp.to!int;
    auto a = n.iota.map!(_ => readln.split.map!(to!int).array).array;

    s = readln.split.map!(to!int);
    auto lx = s[0];
    auto ly = s[1];

    auto ng = new bool[][](lx*2+10, ly*2+10);
    foreach (i; 0..a.length) ng[a[i][0]+lx][a[i][1]+ly] = true;

    auto dist = new int[][][](lx*2+10, ly*2+10, 6);
    foreach (i; 0..lx*2+10) foreach (j; 0..ly*2+10) dist[i][j][] = 1 << 29;

    const int[] dx = [0, 1, 1, 0, -1, -1];
    const int[][] dy = [[1, 0, -1, -1, -1, 0], [1, 1, 0, -1, 0, 1]];

    auto pq = new BinaryHeap!(Array!(Tuple!(int, int, int, int)), "a[3] > b[3]");
    pq.insert(tuple(sx+lx, sy+ly, 0, 0));

    while (!pq.empty) {
        auto x = pq.front[0];
        auto y = pq.front[1];
        auto t = pq.front[2];
        auto d = pq.front[3];
        pq.removeFront;
        if (dist[x][y][t%6] <= d) continue;
        dist[x][y][t%6] = d;
        foreach (i; 0..6) {
            int nx = x + dx[i];
            int ny = y + dy[((x-lx)%2+2)%2][i];
            int nt = (t + 1) % 6;
            int nd = abs((x - lx) * (y - ly) * t) % 6 == i ? d : d + 1;
            if (nx < 0 || nx > 2 * lx || ny < 0 || ny > 2 * ly) continue;
            if (ng[nx][ny]) continue;
            if (dist[nx][ny][nt%6] <= nd) continue;
            pq.insert(tuple(nx, ny, nt, nd));
        }
        if (dist[x][y][(t+1)%6] > d + 1) {
            pq.insert(tuple(x, y, (t+1)%6, d+1));
        }
    }

    int ans = dist[gx+lx][gy+ly].reduce!min;
    writeln(ans == 1 << 29 ? -1 : ans);
}

