#include <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)

const int maxN = 50000;
const double eps=1e-6;
double x[maxN],r[maxN];
pair<double,int> p[maxN*2];
int n;

bool Check(double l){
	double l2=l*l;
	int c=0;
	REP(i,n){
		if(r[i]<=l2)
			continue;
		double s=sqrt(r[i]-l2);
		p[c++]=make_pair(x[i]-s,1);
		p[c++]=make_pair(x[i]+s,-1);
	}
	sort(p,p+c);
	double a;
	double b=0;
	int k=0;
	REP(i,c){
		if(!k)
			a=p[i].first;
		if((k+=p[i].second)==0)
			b=max(b,p[i].first-a);
	}
	return b>=l*2;
}
	
int main(){
	while(1){
		
	scanf("%d",&n);
	if(!n) break;
	double b=0,t=0;
	REP(i,n){
		double a;
		scanf("%lf%lf",&x[i],&a);
		r[i]=a*a;
		t=max(t,a);
	}
	while(t-b>eps){
		double m=(b+t)/2;
		if(Check(m))
			b=m;
		else
			t=m;
	}
	printf("%.6lf\n",b*2);
	
	}
}