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 <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <map>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e12;
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};

namespace std{
    bool operator < (const P& a, const P& b){
        return !EQ(a.X,b.X) ? a.X<b.X : a.Y+EPS<b.Y;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}

bool intersectSP(const L& s, const P &p){
    return abs(cross(s[0]-p, s[1]-p))<EPS  && dot(s[0]-p, s[1]-p)<EPS;
}
bool intersectSS(const L& a, const L& b){
    return ( ccw(a[0],a[1],b[0]) *ccw(a[0],a[1],b[1]) <= 0 ) &&
        ( ccw(b[0],b[1],a[0]) *ccw(b[0],b[1],a[1]) <= 0 );
}

bool isParallel(const P &a, const P &b){
    return abs(cross(a,b)) < EPS;
}
bool isParallel(const L &a, const L &b){
    return isParallel(a[1]-a[0], b[1]-b[0]);
}
P crosspointLL(const L &l, const L &m) {
  double A = cross(l[1]-l[0], m[1]-m[0]);
  double B = cross(l[1]-l[0], l[1]-m[0]);
  return m[0] + B/A *(m[1]-m[0]);
}

double getarea(const VP &poly){
    double ret = 0;
    for (int i=0; i<(int)poly.size(); i++){ 
        ret += cross(poly[i], poly[(i+1)%poly.size()]);
    }
    return ret*0.5;
}
int in_poly(const P &p, const VP &poly){
    int n = poly.size();
    int ret = -1;
    for(int i=0; i<n; i++){
        P a = poly[i]-p;
        P b = poly[(i+1)%n]-p;
        if(a.Y > b.Y) swap(a,b);
        if(intersectSP(L(a,b), P(0,0))) return 0;
        if(a.Y<=0 && b.Y>0 && cross(a,b)<0) ret = -ret;
    }
    return ret;
}

VP convex(VP v){
    VP ret;
    int n = v.size();
    sort(v.begin(), v.end());
    for(int i=0; i<n; i++){
        while((int)ret.size()>1 && cross(ret.back()-ret[ret.size()-2], v[i]-ret.back()) < EPS){
            ret.pop_back();
        }
        ret.push_back(v[i]);
    }
    int t = ret.size();
    for(int i=n-2; i>=0; i--){
        while((int)ret.size()>t && cross(ret.back()-ret[ret.size()-2], v[i]-ret.back()) < EPS){
            ret.pop_back();
        }
        ret.push_back(v[i]);
    }
    if((int)ret.size() > 1) ret.pop_back();
    return ret;
}

VP convex_cut(const VP& p, const L& l){
    VP ret;
    int n = p.size();
    for(int i=0; i<n; i++){
        P curr = p[i];
        P next = p[(i+1)%n];
        if(ccw(l[0], l[1], curr) != -1) ret.push_back(curr);
        if(ccw(l[0], l[1], curr) *ccw(l[0], l[1], next) == -1){
            ret.push_back(crosspointLL(L(curr, next), l));
        }
    }
    return ret;
}

VP convex_intersect(VP a, VP b){
    VP plist;
    int n=a.size(), m=b.size();
    for(int r=0; r<2; r++){
        for(int i=0; i<n; i++){
            if(in_poly(a[i], b) >= 0){
                plist.push_back(a[i]);
            }
        }
        swap(n, m);
        swap(a, b);
    }
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            L la(a[i], a[(i+1)%n]), lb(b[j], b[(j+1)%m]);
            if(!isParallel(la, lb) && intersectSS(la, lb)){
                plist.push_back(crosspointLL(la, lb));
            }
        }
    }
    return convex(plist);
}

vector<VP> volonoi_division(VP plist, VP poly){
    int m = plist.size();
    vector<VP> ret(m);
    for(int i=0; i<m; i++){
        VP v = poly;
        for(int j=0; j<m; j++){
            if(i==j) continue;
            P mid = (plist[i]+plist[j])/2.0;
            L bisector(mid, mid +(plist[j]-plist[i])*P(0,1));
            VP cut = convex_cut(v, bisector);
            v = convex_intersect(v, cut);
        }
        ret[i] = v;
    }
    return ret;
}

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==0) break;

        VP plist(n);
        for(int i=0; i<n; i++){
            double x,y;
            cin >> x >> y;
            plist[i] = P(x, y);
        }
        VP sq{P(0, 0), P(4, 0), P(4, 4), P(0, 4)};
        vector<VP> poly = volonoi_division(plist, sq);

        vector<L> edge;
        for(int i=0; i<n; i++){
            int m = poly[i].size();
            for(int j=0; j<m; j++){
                edge.push_back(L(poly[i][j], poly[i][(j+1)%m]));
            }
        }
        int m = edge.size();
        map<P, int> conv;
        int count = 0;
        for(int i=0; i<m; i++){
            for(int d=0; d<2; d++){
                if(conv.count(edge[i][d]) == 0){
                    conv[edge[i][d]] = count;
                    count++;
                }
            }
        }

        vector<vector<double> > adj(count, vector<double>(count, INF));
        for(int i=0; i<(int)edge.size(); i++){
            int idx0 = conv[edge[i][0]];
            int idx1 = conv[edge[i][1]];
            if(EQ(edge[i][0].Y, edge[i][1].Y) && (EQ(edge[i][0].Y, 0) || EQ(edge[i][0].Y, 4))){
                continue;
            }
            if(EQ(edge[i][0].X, edge[i][1].X) && (EQ(edge[i][0].X, 0) || EQ(edge[i][0].X, 4))){
                adj[idx0][idx1] = adj[idx1][idx0] = 0;
                continue;
            }
            adj[idx0][idx1] = adj[idx1][idx0] = abs(edge[i][1] -edge[i][0]);
        }
        for(int k=0; k<count; k++){
            for(int i=0; i<count; i++){
                for(int j=0; j<count; j++){
                    adj[i][j] = min(adj[i][j], adj[i][k] +adj[k][j]);
                }
            }
        }

        double ans = adj[conv[P(0,0)]][conv[P(4,4)]];
        if(ans == INF){
            cout << "impossible" << endl;
        }else{
            cout << fixed << setprecision(10);
            cout << ans << endl;
        }
    }
    return 0;
}