Brave Ponta has finally arrived at the final dungeon. This is a dark wilderness in front of the fort of the evil emperor Boromos, with fairly strong monsters guarding their territories.

<image>


Figure 1: Wilderness

As shown in Fig. 1, the wilderness is represented by a 4 × 4 square region with the southwest as the origin (0, 0). Inside this area are monsters, as shown by the dots in the figure. Brave Ponta must cross this area from west to east (W to E). That is, you must start from the point where the x coordinate is 0.0 and the y coordinate is 0.0 or more and 4.0 or less, and move to the point where the x coordinate is 4.0 and the y coordinate is 0.0 or more and 4.0 or less.

When an enemy enters the area, the monster attacks the enemy if the distance between him and the enemy is shorter than the distance between any other monster and the enemy.

Now that there are not enough items, it was Ponta who really wanted to avoid fighting as much as possible before fighting Boromos. There, Ponta noticed: If you follow the path where there are always two or more monsters with the shortest distance to you, you won't be attacked by monsters.

Whether the brave Ponta can reach Boromos unscathed depends on your control. Create a program to find the shortest distance through the dark wilderness.

For reference, the shortest path in FIG. 1 is shown in FIG.

<image>


Figure 2: Shortest path



Input

Multiple datasets are given as input. Each dataset is given in the following format:

n (number of monsters: integer)
x1 y1 (Position of the first monster: Real number separated by blanks)
x2 y2 (Position of the second monster: Real number separated by blanks)
..
..
xn yn (position of nth monster: real number separated by blanks)


n is 1 or more and 20 or less. The x and y coordinate values ​​that indicate the position of the monster are 0.0 or more and 4.0 or less.

When n is 0, it indicates the end of input.

Output

Output the shortest distance on one line for each dataset. If you can't cross the wilderness without being attacked by a monster, print "impossible".

The distance output may have an error of 0.00001 or less.

Example

Input

2
1 1
3 3
4
1.0 0.5
1.0 2.5
3.0 1.5
3.0 3.5
1
2.0 2.0
0


Output

5.656854249492
4.618033988750
impossible

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
import math
import heapq
EPS = 1e-08
pp0 = [0j, 4 + 0j, 4 + 4j, 4j]

def EQ(a, b):
	return abs(a - b) < EPS

def PPeQ(a, b):
	return EQ(a.real, b.real) and EQ(a.imag, b.imag)

def dcmp(x):
	if PPeQ(x, 0):
		return 0
	return -1 if x <= 0 else 1

def cross(a, b):
	return a.real * b.imag - a.imag * b.real

def vabs(a):
	return math.hypot(a.real, a.imag)

def crossPointS2P(seg, bs, be):
	a1 = cross(be - bs, seg[0] - bs)
	a2 = cross(be - bs, seg[1] - bs)
	return complex((seg[0].real * a2 - seg[1].real * a1) / (a2 - a1), (seg[0].imag * a2 - seg[1].imag * a1) / (a2 - a1))

def bisector(a, b):
	(ax, ay) = ((a.real + b.real) / 2, (a.imag + b.imag) / 2)
	if EQ(a.imag, b.imag):
		return [complex(ax, ay), complex(ax, ay + (b.real - a.real) * 100)]
	t = ax - (b.imag - a.imag) * 100
	return [complex(ax, ay), complex(t, (ax - t) * (b.real - a.real) / (b.imag - a.imag) + ay)]

def convex_cut(seg, p):
	(ans, n) = ([], len(p))
	for i in range(n):
		d1 = dcmp(cross(seg[1] - seg[0], p[i] - seg[0]))
		t = p[0] if i + 1 == n else p[i + 1]
		d2 = dcmp(cross(seg[1] - seg[0], t - seg[0]))
		if d1 >= 0:
			ans.append(p[i])
		if d1 * d2 < 0:
			ans.append(crossPointS2P(seg, p[i], t))
	return ans

def pushBack(a, b):
	if EQ(tbl[a].imag, 0) and EQ(tbl[b].imag, 0):
		return
	if EQ(tbl[a].imag, 4) and EQ(tbl[b].imag, 4):
		return
	if b in to[a]:
		return
	to[a].append(b)

def dijkstra(V, to, tbl):
	visited = [0] * V
	Q = []
	for i in range(V):
		if EQ(tbl[i].real, 0):
			heapq.heappush(Q, (0, i, 0))
			visited[i] = 1
	while Q:
		(t, s, x) = heapq.heappop(Q)
		if EQ(x, 4):
			return t
		for e in to[s]:
			if visited[e]:
				continue
			visited[e] = 1
			heapq.heappush(Q, (t + vabs(tbl[s] - tbl[e]), e, tbl[e].real))
	return -1
while True:
	n = int(input())
	if n == 0:
		break
	p = []
	for i in range(n):
		(x, y) = map(float, input().split())
		p.append(complex(x, y))
	if n == 1:
		print('impossible')
		continue
	(tbl, sz) = ([], 0)
	to = [[] for i in range(50)]
	for i in range(n):
		po = pp0[0:]
		for j in range(n):
			if j == i:
				continue
			seg = bisector(p[i], p[j])
			po = convex_cut(seg, po)
		w = len(po)
		if w <= 1:
			continue
		if w == 2:
			(a, sz) = (sz, sz + 1)
			tbl.append(po[0])
			(b, sz) = (sz, sz + 1)
			tbl.append(po[1])
			pushBack(a, b)
			pushBack(b, a)
		else:
			j = sz
			sz += w
			tbl.extend(po)
			(a, c) = (w - 1, 1)
			for b in range(w):
				pushBack(j + b, j + a)
				pushBack(j + b, j + c)
				(a, c) = (a + 1, c + 1)
				if a == w:
					a = 0
				if c == w:
					c = 0
	for i in range(sz):
		for j in range(i + 1, sz):
			if PPeQ(tbl[i], tbl[j]):
				pushBack(i, j)
				pushBack(j, i)
	ans = dijkstra(sz, to, tbl)
	print('impossible' if ans < 0 else ans)