import java.lang.Math.sqrt
import java.util.*

data class Point(val x:Double, val y:Double){
    operator fun plus(other:Point):Point = Point(x + other.x, y + other.y)
    operator fun minus(other:Point):Point = Point(x - other.x, y - other.y)
}
data class Circle(val center:Point, val radius:Double)
class Line private constructor(private val mA:Double, val mB:Double, val mC:Double){// ax + by + c = 0
    constructor(point:Point, angle:Angle):this(-angle.sin, angle.cos, angle.sin * point.x - angle.cos * point.y)
    companion object {
        private fun isParallel(lineA:Line, lineB:Line):Boolean {
            return lineA.mA * lineB.mB == lineA.mB * lineB.mA
        }
        fun crossPoint(lineA:Line, lineB:Line):Point? {
            if (isParallel(lineA, lineB)) return null
            // ab'x + bb'y + b'c = 0
            val x = (lineB.mC * lineA.mB - lineA.mC * lineB.mB) / (lineA.mA * lineB.mB - lineB.mA * lineA.mB)
            // aa'x + a'by + a'c = 0
            val y = (lineB.mA * lineA.mC - lineA.mA * lineB.mC) / (lineA.mA * lineB.mB - lineB.mA * lineA.mB)
            return Point(x, y)
        }
    }
}
data class Angle(val sin:Double, val cos:Double){
    operator fun plus(other:Angle):Angle = Angle(sin * other.cos + cos * other.sin, cos * other.cos - sin * other.sin)
    operator fun minus(other:Angle):Angle = Angle(sin * other.cos - cos * other.sin, cos * other.cos + sin * other.sin)
}
data class Edge(val endA:Point, val endB:Point)
fun distance(a:Point, b:Point):Double{
    return sqrt((a - b).let{it.x * it.x + it.y * it.y}.toDouble())
}
fun isBlocked(edge:Edge, circle: Circle):Boolean {
    val ab = edge.endB - edge.endA
    val ac = circle.center - edge.endA
    if ((ab.x * ac.y - ac.x * ab.y).let{it * it} >= (circle.radius * circle.radius * (ab.x * ab.x + ab.y * ab.y))) return false
    val bc = circle.center - edge.endB
    return ab.x * ac.x + ab.y * ac.y > 0 && ab.x * bc.x + ab.y * bc.y < 0
}

fun minDistanceByCircle(a:Triple<Point, Iterable<Line>, Iterable<Line>>, b:Triple<Point, Iterable<Line>, Iterable<Line>>, circles:Pair<Circle, Circle>):Double? {
    val (ca, cb) = circles
    if (!isBlocked(Edge(a.first, b.first), ca) && !isBlocked(Edge(a.first, b.first), cb)) return distance(a.first, b.first)
    val (ap, aaLines, abLines) = a
    val (bp, baLines, bbLines) = b
    return (
            aaLines.flatMap { aa -> baLines.mapNotNull { ba -> Line.crossPoint(aa, ba) } }.filterNot{
                isBlocked(Edge(ap, it), cb) || isBlocked(Edge(bp, it), cb)
            }.map{distance(ap, it) + distance(bp, it)} +
            aaLines.flatMap { aa -> bbLines.mapNotNull { bb -> Line.crossPoint(aa, bb) } }.filterNot {
                isBlocked(Edge(ap, it), cb) || isBlocked(Edge(bp, it), ca)
            }.map{distance(ap, it) + distance(bp, it)} +
            abLines.flatMap { ab -> baLines.mapNotNull { ba -> Line.crossPoint(ab, ba) } }.filterNot{
                isBlocked(Edge(ap, it), ca) || isBlocked(Edge(bp, it), cb)
            }.map{distance(ap, it) + distance(bp, it)} +
            abLines.flatMap { ab -> bbLines.mapNotNull { bb -> Line.crossPoint(ab, bb) } }.filterNot {
                isBlocked(Edge(ap, it), ca) || isBlocked(Edge(bp, it), ca)
            }.map{distance(ap, it) + distance(bp, it)}
            ).filter{it <= 10000.0}.min()
}
fun tangentialLine(point:Point, circle: Circle):Iterable<Line> {
    val relationalCenter = circle.center - point
    val sinSquare = circle.radius.let{it * it} / (relationalCenter.x * relationalCenter.x + relationalCenter.y * relationalCenter.y)
    val cosSquare = 1 - sinSquare
    val rAngle = Angle(sqrt(sinSquare), sqrt(cosSquare))
    val dist = distance(point, circle.center)
    val sin = relationalCenter.y / dist
    val cos = relationalCenter.x / dist
    val aAngle = Angle(sin, cos)
    return listOf(Line(point, aAngle + rAngle), Line(point, aAngle - rAngle))
}
fun factorial(n:Int):Int {
    return when(n){
        0 -> 1
        else -> n * factorial(n - 1)
    }
}
inline fun IntRange.permutations(func:(Iterable<Int>) -> Unit):Unit {
    val array = this.map{it}.toIntArray()
    val stack = Stack<Int>()
    val isUsed = Array(array.size){false}
    val f = Array(array.size){factorial(array.size - it - 1)}
    repeat(factorial(array.size)){
        var count = it
        isUsed.fill(false)
        stack.clear()
        repeat(array.size){
            stack.push(isUsed.withIndex().filterNot{it.value}[count / f[stack.size]].index)
            isUsed[stack.peek()] = true
            count %= f[stack.size - 1]
        }
        func(stack)
    }
}
fun main(args:Array<String>):Unit{
    val n = readLine()!!.trim().toInt()
    val circles = List(2){
        val (x, y, r) = readLine()!!.trim().split(' ').map(String::toDouble)
        Circle(Point(x, y), r)
    }
    val pair = Pair(circles.first(), circles.last())
    val red = Array(n){
        val (x, y) = readLine()!!.trim().split(' ').map(String::toDouble)
        Point(x, y)
    }.map{p -> Triple(p, tangentialLine(p, circles.first()), tangentialLine(p, circles.last()))}.toTypedArray()
    val blue = Array(n){
        val (x, y) = readLine()!!.trim().split(' ').map(String::toDouble)
        Point(x, y)
    }.map{p -> Triple(p, tangentialLine(p, circles.first()), tangentialLine(p, circles.last()))}.toTypedArray()
    //val minCost = searchMinCostMatch(red.map{r -> blue.map{b -> if (circles.any{isBlocked(Edge(r.first, b.first), it)}) minDistanceByCircle(r, b, circles) else distance(r.first, b.first)}.toTypedArray()}.toTypedArray())
    var min = Double.MAX_VALUE
    (0 until n).permutations {
        red.zip(it.map{i -> blue[i]}).map {(a, b) ->
            minDistanceByCircle(a, b, pair) ?: 100000.0
        }.sum().let{
            if (it < min) min = it
        }
    }
    println(if (min > 10000.0) "Impossible" else min)
}
fun searchMinCostMatch(edges:Array<Array<Double?>>):Double? {   //edges[red][blue] => redとblueの最短距離. なければnull
    val n = edges.size  //|Red| == |Blue| == n
    val rPotentialRed = Array(n){0.0}    //potentialRed[red] => redノードのポテンシャル
    val rPotentialBlue = Array(n){b -> edges.mapNotNull{it[b]}.min() ?: return null} //potentialBlue[blue] => blueノードのポテンシャル
    val rMatchingRed = Array(n){-1} //rMatchingRed[red] => redとマッチングしているblueがあればblue. そうでなければ-1
    val rMatchingBlue = Array(n){-1} //rMatchingBlue[blue] => blueとマッチングしているredがあればred.　そうでなければ-1
    val dMinRed = Array(n){Double.MAX_VALUE}    //dijkstra法で最短パスのコスト
    val dMinBlue = Array(n){Double.MAX_VALUE}   //dijkstra法で最短パスのコスト
    val dPrevRed = Array(n){-1}  //dPrevRed[red] => dijkstra法で最短パスの前のノードを保持. -1の場合s
    val dPrevBlue = Array(n){-1}  //dPrevBlue[blue] => dijkstra法で最短パスの前のノードを保持. -1の場合最短パスなし
    val isRenewRed = Array(n){false}
    var rTPotential = 0.0
    repeat(n){
        dMinRed.fill(Double.MAX_VALUE)
        dMinBlue.fill(Double.MAX_VALUE)
        dPrevRed.fill(-1)
        dPrevBlue.fill(-1)
        rMatchingRed.forEachIndexed { red, blue ->
            if (blue == -1) {
                dMinRed[red] = 0.0
                isRenewRed[red] = true
            }
        }
        var tMinCost = Double.MAX_VALUE
        var tIsRenew = false
        var minPath = -1
        while(isRenewRed.any{it} || tIsRenew){
            val (red, cost) = dMinRed.withIndex().filter{isRenewRed[it.index]}.minBy { it.value } ?: IndexedValue(-1, tMinCost)
            tIsRenew = false
            isRenewRed.fill(false)
            if (red == -1 || dMinRed[red] > tMinCost){
                rMatchingBlue.forEachIndexed { blue, nextRed ->
                    if (nextRed != -1){
                        if (dMinBlue[blue] > rTPotential - rPotentialBlue[blue] + tMinCost){
                            dMinBlue[blue] = rTPotential - rPotentialBlue[blue] + tMinCost
                            if (dMinRed[nextRed] > rPotentialBlue[blue] + edges[nextRed][blue]!! - rPotentialRed[nextRed] + dMinBlue[blue]){
                                dMinRed[nextRed] = rPotentialBlue[blue] + edges[nextRed][blue]!! - rPotentialRed[nextRed] + dMinBlue[blue]
                                isRenewRed[nextRed] = true
                            }
                        }
                    }
                }
            }
            else {
                edges[red].forEachIndexed { blue, d ->
                    if (d != null) {
                        if (dMinBlue[blue] > rPotentialRed[red] + d - rPotentialBlue[blue] + cost) {
                            dMinBlue[blue] = rPotentialRed[red] + d - rPotentialBlue[blue] + cost
                            dPrevBlue[blue] = red
                            if (tMinCost > dMinBlue[blue] + rPotentialBlue[blue]){
                                tMinCost = dMinBlue[blue] + rPotentialBlue[blue]
                                tIsRenew = true
                                minPath = blue
                            }
                            if (rMatchingBlue[blue] != -1) {
                                val nextRed = rMatchingBlue[blue]
                                if (dMinRed[nextRed] > rPotentialBlue[blue] + edges[nextRed][blue]!! - rPotentialRed[nextRed] + dMinBlue[blue]) {
                                    dMinRed[nextRed] = rPotentialBlue[blue] + edges[nextRed][blue]!! - rPotentialRed[nextRed] + dMinBlue[blue]
                                    dPrevRed[nextRed] = blue
                                    isRenewRed[nextRed] = true
                                }
                            }
                        }
                    }
                }
            }
        }
        if (minPath == -1) return null
        var blue = minPath
        while(blue != -1){
            val nextBlue = rMatchingRed[dPrevBlue[blue]]
            rMatchingBlue[blue] = dPrevBlue[blue]
            rMatchingRed[dPrevBlue[blue]] = blue
            blue = nextBlue
        }
        for (i in 0 until n){
            rPotentialRed[i] += dMinRed[i]
            rPotentialBlue[i] += dMinBlue[i]
        }
        rTPotential = tMinCost
    }
    return rMatchingRed.mapIndexed { red, blue -> edges[red][blue]!! }.sum()
}
