Problem: 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

Solution (in CPP):

Solution:
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e+10;
const double PI = acos(-1);
inline double ABS(double a){return max(a,-a);}
int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
struct Pt {
    double x, y;
    Pt() {}
    Pt(double x, double y) : x(x), y(y) {}
    Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); }
    Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); }
    Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); }
    Pt operator-() const { return Pt(-x, -y); }
    Pt operator*(const double &k) const { return Pt(x * k, y * k); }
    Pt operator/(const double &k) const { return Pt(x / k, y / k); }
    double ABS() const { return sqrt(x * x + y * y); }
    double abs2() const { return x * x + y * y; }
    double arg() const { return atan2(y, x); }
    double dot(const Pt &a) const { return x * a.x + y * a.y; }
    double det(const Pt &a) const { return x * a.y - y * a.x; }
};
double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); }
int iSP(Pt a, Pt b, Pt c) {
    int s = sig((b - a).det(c - a));
    if (s) return s;
    if (sig((b - a).dot(c - a)) < 0) return -2; // c-a-b
    if (sig((a - b).dot(c - b)) < 0) return +2; // a-b-c
    return 0;
}
int iLL(Pt a, Pt b, Pt c, Pt d) {
    if (sig((b - a).det(d - c))) return 1; // intersect
    if (sig((b - a).det(c - a))) return 0; // parallel
    return -1; // correspond
}
bool iLS(Pt a, Pt b, Pt c, Pt d) {
    return (sig(tri(a, b, c)) * sig(tri(a, b, d)) <= 0);
}
bool iSS(Pt a, Pt b, Pt c, Pt d) {
    return (iSP(a, b, c) * iSP(a, b, d) <= 0 && iSP(c, d, a) * iSP(c, d, b) <= 0);
}
bool iSSstrict(Pt a, Pt b, Pt c, Pt d) {
    return (sig(tri(a, b, c)) * sig(tri(a, b, d)) < 0 && sig(tri(c, d, a)) * sig(tri(c, d, b)) < 0);
}
Pt pLL(Pt a, Pt b, Pt c, Pt d) {
    b = b - a; d = d - c; return a + b * (c - a).det(d) / b.det(d);
}
double dLP(Pt a, Pt b, Pt c) {
    return ABS(tri(a, b, c)) / (b - a).ABS();
}
double dSP(Pt a, Pt b, Pt c) {
    if (sig((b - a).dot(c - a)) <= 0) return (c - a).ABS();
    if (sig((a - b).dot(c - b)) <= 0) return (c - b).ABS();
    return ABS(tri(a, b, c)) / (b - a).ABS();
}
double dLL(Pt a, Pt b, Pt c, Pt d) {
    return iLL(a, b, c, d) ? 0 : dLP(a, b, c);
}
double dLS(Pt a, Pt b, Pt c, Pt d) {
    return iLS(a, b, c, d) ? 0 : min(dLP(a, b, c), dLP(a, b, d));
}
double dSS(Pt a, Pt b, Pt c, Pt d) {
    return iSS(a, b, c, d) ? 0 : min(min(dSP(a, b, c), dSP(a, b, d)), min(dSP(c, d, a), dSP(c, d, b)));
}
vector<Pt> convexCut(int n, vector<Pt>p, Pt a, Pt b) {
    int m = 0, i;
    p.push_back(p[0]);
    vector<Pt>q;
    for (i = 0; i < n; ++i) {
    //  printf("%d %d\n",i,q.size());
        if (sig(tri(a, b, p[i])) >= 0) q.push_back(p[i]);
        if (sig(tri(a, b, p[i])) * sig(tri(a, b, p[i + 1])) < 0)
            q.push_back(pLL(a, b, p[i], p[i + 1]));
    }
    return q;
}
Pt c[23];
Pt d[23];
vector<vector<Pt> > poly[12];
vector<pair<Pt,Pt> >edge;
Pt z[500];
vector<pair<int,double> >g[500];
double ijk[500];
int v[500];
int main(){
    int b;
    while(scanf("%d",&b),b){
        vector<Pt>s;
		int a=4;
		c[0]=Pt(0,0);
		c[1]=Pt(4,0);
		c[2]=Pt(4,4);
		c[3]=Pt(0,4);
		for(int i=0;i<4;i++)s.push_back(c[i]);
        
        for(int i=0;i<b;i++){
            double x,y;scanf("%lf%lf",&x,&y);
            d[i]=Pt(x,y);
        }
		edge.clear();
        for(int i=0;i<b;i++){
            vector<Pt> now=s;
            for(int j=0;j<b;j++){
                if(i==j)continue;
                pair<Pt,Pt> L=make_pair((d[i]+d[j])/2.0,(d[i]+d[j])/2.0+(d[i]-d[j])*Pt(0,1));
                now=convexCut(now.size(),now,L.second,L.first);
            }
			for(int j=0;j<now.size();j++){
				bool dame=false;
				for(int k=0;k<4;k++)if(iLL(now[j],now[(j+1)%now.size()],c[k],c[(k+1)%4])==-1)dame=true;
				if(dame)continue;
				edge.push_back(make_pair(now[j],now[(j+1)%now.size()]));
			}
        }
		int sz=0;
		for(int i=0;i<500;i++){g[i].clear();v[i]=0;ijk[i]=999999999;}
		for(int i=0;i<edge.size();i++){
			if((edge[i].first-edge[i].second).ABS()<EPS)continue;
			int at=-1;
			for(int j=0;j<sz;j++)if((z[j]-edge[i].first).ABS()<EPS){at=j;break;}
			if(!~at){at=sz;z[sz++]=edge[i].first;}
			int at2=-1;
			for(int j=0;j<sz;j++)if((z[j]-edge[i].second).ABS()<EPS){at2=j;break;}
			if(!~at2){at2=sz;z[sz++]=edge[i].second;}
			g[at].push_back(make_pair(at2,(edge[i].first-edge[i].second).ABS()));
			g[at2].push_back(make_pair(at,(edge[i].first-edge[i].second).ABS()));
		}
		priority_queue<pair<double,int> >Q;
		for(int i=0;i<sz;i++){
			if(sig(z[i].x)==0){
				ijk[i]=0;
				Q.push(make_pair(0,i));
			}
		}
		while(Q.size()){
			double cost=-Q.top().first;
			int at=Q.top().second;
			Q.pop();
			if(v[at])continue;
			v[at]=1;
			for(int i=0;i<g[at].size();i++){
				if(!v[g[at][i].first]&&ijk[g[at][i].first]>cost+g[at][i].second){
					ijk[g[at][i].first]=cost+g[at][i].second;
					Q.push(make_pair(-ijk[g[at][i].first],g[at][i].first));
				}
			}
		}
		double ret=999999999;
		for(int i=0;i<sz;i++){
			if(sig(z[i].x-4.0)==0)ret=min(ret,ijk[i]);
		}
		if(ret>9999999)printf("impossible\n");
		else printf("%.12f\n",ret);
    }
}