import core.stdc.stdio;
import std.algorithm;
import std.typecons;
import std.math;

void main(){
	while(1){

	int n;
	scanf("%d",&n);
	if(!n) break;
	double[] x=new double[n],r=new double[n];
	foreach(i;0..n)
		scanf("%lf%lf",&x[i],&r[i]);
	double b = 0;
	double t = r.minPos[0];
	static immutable double eps = 1e-6;
	alias Tuple!(double,"p",int,"i") pi;
	pi[] ps = new pi[n*2];
	bool Check(double l){
		foreach(i;0..n){
			double s=sqrt(r[i]*r[i]-l*l);
			ps[i*2]=pi(x[i]-s,1);
			ps[i*2+1]=pi(x[i]+s,-1);
		}
		sort(ps);
		double a;
		double b=0;
		int k;
		foreach(p;ps){
			if(!k)
				a=p.p;
			if((k+=p.i)==0)
				b=max(b,p.p-a);
		}
		return b>=l*2;
	}
	while(t-b>eps){
		double m=(b+t)/2;
		if(Check(m))
			b=m;
		else
			t=m;
	}
	printf("%.6lf\n",b*2);
	
	}
}