Problem: Long long ago, there were several identical columns (or cylinders) built vertically in a big open space near Yokohama (Fig. F-1). In the daytime, the shadows of the columns were moving on the ground as the sun moves in the sky. Each column was very tall so that its shadow was very long. The top view of the shadows is shown in Fig. F-2.

The directions of the sun that minimizes and maximizes the widths of the shadows of the columns were said to give the important keys to the secrets of ancient treasures.

<image>
Fig. F-1: Columns (or cylinders)

<image>
Gig. F-2: Top view of the columns (Fig. F-1) and their shadows

The width of the shadow of each column is the same as the diameter of the base disk. But the width of the whole shadow (the union of the shadows of all the columns) alters according to the direction of the sun since the shadows of some columns may overlap those of other columns.

Fig. F-3 shows the direction of the sun that minimizes the width of the whole shadow for the arrangement of columns in Fig. F-2.

<image>
Fig. F-3: The direction of the sun for the minimal width of the whole shadow



Fig. F-4 shows the direction of the sun that maximizes the width of the whole shadow. When the whole shadow is separated into several parts (two parts in this case), the width of the whole shadow is defined as the sum of the widths of the parts.

<image>
Fig. F-4: The direction of the sun for the maximal width of the whole shadow



A direction of the sun is specified by an angle θ defined in Fig. F-5. For example, the east is indicated by θ = 0, the south by θ = π/2, and the west by θ = π. You may assume that the sun rises in the east (θ = 0) and sets in the west (θ = π).

Your job is to write a program that, given an arrangement of columns, computes two directions θmin and θmax of the sun that give the minimal width and the maximal width of the whole shadow, respectively.

The position of the center of the base disk of each column is specified by its (x, y) coordinates. The x-axis and y-axis are parallel to the line between the east and the west and that between the north and the south, respectively. Their positive directions indicate the east and the north, respectively.

You can assume that the big open space is a plane surface.

<image>
Fig. F-5: The definition of the angle of the direction of the sun

There may be more than one θmin or θmax for some arrangements in general, but here, you may assume that we only consider the arrangements that have unique θmin and θmax in the range 0 ≤ θmin < π, 0 ≤ θmax < π.



Input

The input consists of multiple datasets, followed by the last line containing a single zero.

Each dataset is formatted as follows.



n
x1 y1
x2 y2
...
xn yn


n is the number of the columns in the big open space. It is a positive integer no more than 100.

xk and yk are the values of x-coordinate and y-coordinate of the center of the base disk of the k-th column (k=1, ..., n). They are positive integers no more than 30. They are separated by a space.

Note that the radius of the base disk of each column is one unit (the diameter is two units). You may assume that some columns may touch each other but no columns overlap others.

For example, a dataset


3
1 1
3 1
4 3


corresponds to the arrangement of three columns depicted in Fig. F-6. Two of them touch each other.

<image>
Fig. F-6: An arrangement of three columns

Output

For each dataset in the input, two lines should be output as specified below. The output lines should not contain extra characters such as spaces.

In the first line, the angle θmin, the direction of the sun giving the minimal width, should be printed. In the second line, the other angle θmax, the direction of the sun giving the maximal width, should be printed.

Each angle should be contained in the interval between 0 and π (abbreviated to [0, π]) and should not have an error greater than ε=0.0000000001 (=10-10).

When the correct angle θ is in [0,ε], approximate values in [0,θ+ε] or in [π+θ-ε, π] are accepted. When the correct angle θ is in [π-ε, π], approximate values in [0, θ+ε-π] or in [θ-ε, π] are accepted.

You may output any number of digits after the decimal point, provided that the above accuracy condition is satisfied.

Example

Input

3
1 1
3 1
4 3
4
1 1
2 3
3 8
1 9
8
1 1
3 1
6 1
1 3
5 3
1 7
3 5
5 5
8
20 7
1 27
30 14
9 6
17 13
4 2
17 7
8 9
0


Output

2.553590050042226
0.982793723247329
1.570796326794896
2.819842099193151
1.325817663668032
2.094395102393196
2.777613697080149
0.588002603547568

Solution (in CPP):

Solution:
#include<cstdio>
#include<complex>
#include<vector>
#include<cmath>
#include<iostream>
#include<string>
#include<utility>
#include<algorithm>

using namespace std;

typedef double Real;

typedef complex<Real> Point;
typedef complex<Real> Vector;
typedef pair<Point,Point> Segment;
typedef vector<Point> Polygon;

typedef pair<Real,int> P;
typedef pair<Real,Real> PR;

const Real eps=1e-9;
const Real PI=acos(-1.0);
const Real inf=1e9;

template<class T> bool eq(T a,T b){
	return abs(a-b)<eps;
}
template<class T> int sgn(T a){
	if(eq(a,0.0)) return 0;
	if(a>0) return 1;
	return -1;
}

Real arg(Vector v){
	return atan2(v.imag(),v.real());
}

Real getDis(Real a,Real x,Real y){
	return (a*x-y)/sqrt(a*a+1.0);
}

int xs[110],ys[110];
Point pts[110];
int N;

int NUM=0;

Real get(vector<P> vec){
	Real res=0;
	sort(vec.begin(),vec.end());
	int cnt=0;
	Real prev=-inf;
	for(int i=0;i<vec.size();i++){
		Real x=vec[i].first;
		int y=vec[i].second;
//		printf("(%f,%d)\n",x,y);
		if(cnt>0){
			res+=(x-prev);
		}
		prev=x;
		cnt+=y;
	}
//	printf("res=%f\n",res);
//	NUM++;
//	if(NUM==20) exit(0);
//	exit(0);
	return res;
}

Real calc(Real ang){
	vector<P> vec;
	if(eq(ang,PI/2)){
		for(int i=0;i<N;i++){
			vec.push_back(P(xs[i]-1,1));
			vec.push_back(P(xs[i]+1,-1));
		}
	}else{
		for(int i=0;i<N;i++){
		//	Real d=getDis(tan(PI/2-ang),xs[i],ys[i]);
			Real d=getDis(tan(-ang),xs[i],ys[i]);
			vec.push_back(P(d-1,1));
			vec.push_back(P(d+1,-1));
		}
	}
	Real res=get(vec);
	return res;
}

vector<Real> borders;

Real normalize(Real ang){
	if(sgn(ang)<=0){
		return -ang;
	}
	return abs(ang-PI);
}

Real normalize2(Real ang){
	while(ang<0) ang+=PI;
	while(ang>PI) ang-=PI;
	return ang;
}

void solve(Real lb,Real ub);

void solve(){
	for(int i=0;i<N;i++) for(int j=i+1;j<N;j++){
		Vector v=pts[j]-pts[i];
		Real theta=arg(v);
		theta=normalize(theta);
		borders.push_back(theta);
		if(eq(abs(v),2.0)){
			if(sgn(theta-PI/2)>=0){
				borders.push_back(theta-PI/2);
			}else{
				borders.push_back(theta+PI/2);
			}
		}else{
			Real d=abs(v);
			Real phi=asin(2.0/d);
			borders.push_back(normalize2(theta+phi));
			borders.push_back(normalize2(theta-phi));
		}
	}
	sort(borders.begin(),borders.end());
	for(int i=0;i+1<borders.size();i++){
		solve(borders[i],borders[i+1]);
	}
}

PR mi,Ma;

void solve(Real lb,Real ub){
//	printf("[%f,%f]\n",lb,ub);
	Real x=calc(lb);
	mi=min(mi,PR(x,lb));
	Ma=max(Ma,PR(x,lb));
	x=calc(ub);
	mi=min(mi,PR(x,ub));
	Ma=max(Ma,PR(x,ub));
	if(eq(lb,ub)) return;
#if 0
	for(int stage=0;stage<100;stage++){
		Real dif=ub-lb;
		if(dif<eps) break;
		Real ang1=lb+(dif/3.0);
		Real ang2=lb+(dif*2/3.0);
		Real val1=calc(ang1);
		Real val2=calc(ang2);
		if(val1<val2){
			lb=ang1;
		}else{
			ub=ang2;
		}
	}
	Real val=calc(lb);
	Ma=max(Ma,PR(val,lb));
#endif
	vector<P> tmp;
	Real mid=(ub+lb)/2;
	for(int i=0;i<N;i++){
		Real L=sqrt(xs[i]*xs[i]+ys[i]*ys[i]);
		Real phi=atan2(ys[i],xs[i]);
		tmp.push_back(P(L*(sin(mid+phi)),i));
	}
	sort(tmp.begin(),tmp.end());
	Real coe_c=0,coe_s=0;
	Real c=0;
	for(int i=0;i<N;i++){
		if(i==0||sgn(tmp[i].first-tmp[i-1].first-2.0)>0){
			c+=1.0;
			int id=tmp[i].second;
			Real L=abs(pts[id]);
			Real phi=atan2(ys[id],xs[id]);
			coe_c-=L*sin(phi);
			coe_s-=L*cos(phi);
		}
		if(i==N-1||sgn(tmp[i+1].first-tmp[i].first-2.0)>0){
			c+=1.0;
			int id=tmp[i].second;
			Real L=abs(pts[id]);
			Real phi=atan2(ys[id],xs[id]);
			coe_c+=L*sin(phi);
			coe_s+=L*cos(phi);
		}
	}
	Real A=coe_c,B=coe_s;
	Real phi=-atan2(B,-A);
	phi=normalize2(phi);
//	printf("%f %f %f\n",lb,phi,ub);
	if(sgn(phi-lb)>=0&&sgn(ub-phi)>=0){
		Real x=calc(phi);
		Ma=max(Ma,PR(x,phi));
	}
}

void init(){
	borders.clear();
	mi=PR(inf,0);
	Ma=PR(-inf,0);
}

void input(){
	scanf("%d",&N);
	for(int i=0;i<N;i++){
		scanf("%d%d",xs+i,ys+i);
		pts[i]=Point(xs[i],ys[i]);
	}
}

int main(){
	int T=0;
	while(true){
		init();
		input();
		if(N==0) break;
//		if(T<60){
//			T++;
//			continue;
//		}
		solve();
		if(eq(mi.second,PI)) mi.second=0;
		if(eq(Ma.second,PI)) Ma.second=0;
		printf("%.12f\n",mi.second);
		printf("%.12f\n",Ma.second);
		T++;
//		if(T>=60&&T<70){
//			fprintf(stderr,"case %d\n",T);
//			fprintf(stderr,"borders.size()=%d\n",borders.size());
//		}
	}
	return 0;
}