import java.lang.IllegalStateException
import java.lang.Math.abs
import java.math.BigInteger
import java.util.*
import kotlin.collections.ArrayList

fun main(args: Array<String>?): Unit {
    val (sx, sy, gx, gy) = readLine()!!.trim().split(' ').map(String::toInt)
    val canEnter = Array(203){Array(203){true}}
    val (dx, dy) = Pair(101, 101)
    repeat(readLine()!!.trim().toInt()) {
        val (x, y) = readLine()!!.trim().split(' ').map(String::toInt)
        canEnter[x + dx][y + dy] = false
    }
    val (lx, ly) = readLine()!!.trim().split(' ').map(String::toInt)
    for (x in canEnter.indices)
        for (y in canEnter[x].indices) canEnter[x][y] = canEnter[x][y] && abs(x - dx) in 0 .. lx && abs(y - dy) in 0 .. ly
    val deque = ArrayDeque<Pair<Coordinate, Int>>().also{it.add(Pair(Coordinate(sx, sy), 0))}
    val minIgnore = Array(203){Array(203){Array(6){Int.MAX_VALUE}}}
    minIgnore[sx + dx][sy + dy][0] = 0
    val goal = Coordinate(gx, gy)
    while(deque.isNotEmpty() && deque.first.first != goal) {
        val (current, time) = deque.pollFirst()!!
        val order = (abs(current.x * current.y * time) % 6).toDirection()
        //println("$current, time: $time, current min: ${minIgnore[current.x + 100][current.y + 100][time]}, next : ${current + order}")
        if (minIgnore[current.x + dx][current.y + dy][(time + 1) % 6] > minIgnore[current.x + dx][current.y + dy][time] + 1) {
            minIgnore[current.x + dx][current.y + dy][(time + 1) % 6] = minIgnore[current.x + dx][current.y + dy][time] + 1
            deque.addLast(Pair(current, (time + 1) % 6))
        }
        for (dir in Direction.allValues) {
            val next = current + dir
            if (dir == order && canEnter[next.x + dx][next.y + dy] && minIgnore[next.x + dx][next.y + dy][(time + 1) % 6] > minIgnore[current.x + dx][current.y + dy][time]) {
                minIgnore[next.x + dx][next.y + dy][(time + 1) % 6] = minIgnore[current.x + dx][current.y + dy][time]
                deque.addFirst(Pair(next, (time + 1) % 6))
            }else if (canEnter[next.x + dx][next.y + dy] && minIgnore[next.x + dx][next.y + dy][(time + 1) % 6] > minIgnore[current.x + dx][current.y + dy][time] + 1) {
                minIgnore[next.x + dx][next.y + dy][(time + 1) % 6] = minIgnore[current.x + dx][current.y + dy][time] + 1
                deque.addLast(Pair(next, (time + 1) % 6))
            }
        }
    }
    if (deque.isEmpty()) {
        println(-1)
    }else {
        val (_, time) = deque.first
        println(minIgnore[goal.x + dx][goal.y + dy][time])
    }
}
data class Coordinate(val x: Int, val y: Int) {
    operator fun plus(that: Direction): Coordinate {
        return when {
            x % 2 == 0 -> this + directionEven(that)
            else -> this + directionOdd(that)
        }
    }
    operator fun plus(that: Coordinate): Coordinate = Coordinate(x + that.x, y + that.y)
    companion object {
        private fun directionEven(dir: Direction): Coordinate {
            return when(dir){
                Direction.Zero -> Coordinate(0, 1)
                Direction.One -> Coordinate(1, 0)
                Direction.Two -> Coordinate(1, -1)
                Direction.Three -> Coordinate(0, -1)
                Direction.Four -> Coordinate(-1, -1)
                Direction.Five -> Coordinate(-1, 0)
            }
        }
        private fun directionOdd(dir: Direction): Coordinate {
            return when(dir) {
                Direction.Zero -> Coordinate(0, 1)
                Direction.One -> Coordinate(1, 1)
                Direction.Two -> Coordinate(1, 0)
                Direction.Three -> Coordinate(0, -1)
                Direction.Four -> Coordinate(-1, 0)
                Direction.Five -> Coordinate(-1, 1)
            }
        }
    }
}
sealed class Direction(val toInt: Int) {
    object Zero: Direction(0)
    object One: Direction(1)
    object Two: Direction(2)
    object Three: Direction(3)
    object Four: Direction(4)
    object Five: Direction(5)
    companion object {
        val allValues = arrayOf(Zero, One, Two, Three, Four, Five)
        fun fromInt(n: Int): Direction {
            return allValues[n]
        }
    }
}
fun Int.toDirection(): Direction {
    return Direction.fromInt(this)
}

