#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);
    }
}

Measured memory_bytes: 1132