#include<bits/stdc++.h>
using namespace std;

long long int multiply_dp(long long int);

 int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);

long long int dp[10][1000001];

	for(long long int i=1;i<=1000000;i++){
		dp[multiply_dp(i)][i]++;
	}
	for(long long int i=1;i<10;i++){
		for(long long int j=1;j<=1000000;j++){
			dp[i][j]+=dp[i][j-1];
		}
	}
	long long int t;
	cin>>t;
	while(t--){
		long long int l,r,k;
		cin>>l>>r>>k;
		cout<<dp[k][r]-dp[k][l-1]<<endl;
	}

	return 0;
}

long long int multiply_dp(long long int n){
	long long int jio=1;

	if(n<10)
		return n;

	while(n){
		if(n%10)
			jio*=(n%10);
		n/=10;
	}

	return multiply_dp(jio);
}


#include "bits/stdc++.h"

#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a)		cerr<<#a<<" : "<<a<<endl
#else
#define tr(a)
#endif

#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)	for(int i=a;i<b;i++)
using namespace std;

int x[10][1000005];

int f(int x){
	if(x<10)return x;
	int prod=1;
	while(x){
		if(x%10)prod*=(x%10);
		x/=10;
	}
	return f(prod);
}

void solve(){
	for(int i=1;i<=1000000;i++){
		x[f(i)][i]++;
	}
	for(int i=1;i<10;i++){
		for(int j=1;j<=1000000;j++){
			x[i][j]+=x[i][j-1];
		}
	}
	int Q;
	cin>>Q;
	while(Q--){
		int l,r,k;
		cin>>l>>r>>k;
		cout<<x[k][r]-x[k][l-1]<<endl;
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_set>

using namespace std;

#define all(v)          ((v).begin()), ((v).end())
#define sz(v)           ((int)((v).size()))
#define endl            "\n"
#define fx(n)           fixed<<setprecision(n)

typedef long long ll;

void File()
{
	//freopen("output.txt", "w", stdout);
	freopen("colors.in", "r", stdin);
}
void fast()
{
	ios::sync_with_stdio(NULL);
	cout.tie(NULL);
	cin.tie(NULL);
}
const double pi = 2 * acos(0.0);
const int nn = 2e5 + 5;
const int oo = 0x3f3f3f3f;

int main()
{
	fast();
	int r1, p1, p2;
	cin >> r1;
	vector<int> arr1(r1 + 1);
	for (int i = 0; i < r1; i++)
		cin >> arr1[i];
	cin >> p1;
	vector<int> arr2(p1 + 1);
	for (int i = 0; i < p1; i++)
		cin >> arr2[i];
	cin >> p2;
	vector<int> arr3(p2 + 1);
	for (int i = 0; i < p2; i++)
		cin >> arr3[i];
	double a, b, res = 0;
	cin >> a >> b;
	for (int i = 0; i < r1; i++)
	{
		for (int j = 0; j < p1; j++)
		{
			for (int k = 0; k < p2; k++)
			{
				double ans = (pi*b*arr2[j] * arr1[i] * arr1[i]) / (pi*(a*arr3[k] + b*arr2[j]));
				ans = sqrt(ans);
				res = max(res, ans);
			}
		}
	}
	cout << fx(12);
	cout << res << endl;
#if _DEBUG
	system("pause");
#endif
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int > vi;
typedef vector<long long> vll;

int main()
{
   int a;
   cin>>a;
   vll va(a);
   ll r=-1;
   for(ll i=0;i<a;i++){
    cin>>va[i];
    r=max(r,va[i]);
   }
   ll b;
   cin>>b;
   vll vb(b);
   ll px=-1;
   for(ll i=0;i<b;i++){
    cin>>vb[i];
    px=max(px,vb[i]);
   }
   ll c;
   cin>>c;
   vll vc(c);
   ll p=1000000;
   for(ll i=0;i<c;i++){
    cin>>vc[i];
    p=min(p,vc[i]);
   }
   ll A,B;
   cin>>A>>B;
   ll maxx=-1,minn=1000000;

    for(int j=0;j<b;j++){
        maxx=max(maxx,r*r*px*B);

        }

   for(int i=0;i<b;i++){
    for(int j=0;j<c;j++){
        minn=min(minn,p*A+px*B);
    }
   }
   double answer=0;
   answer=sqrt((double)maxx/minn);
   printf("%.12f",answer);

}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int > vi;
typedef vector<long long> vll;

int main()
{
    int a;
    cin>>a;
    vi va(a);
    double r;
    for(int i=0;i<a;i++){
        cin>>va[i];
    }
    r=*max_element(va.begin(),va.end());
    int b;
    cin>>b;
    vi vb(b);
    for(int i=0;i<b;i++){
        cin>>vb[i];
    }
    double p1=*max_element(vb.begin(),vb.end());
    int c;
    cin>>c;
    vi vc(c);
    for(int i=0;i<c;i++){
        cin>>vc[i];
    }
    double p2=*min_element(vc.begin(),vc.end());
    double x,y;
    cin>>x>>y;
    double ans=sqrt(((double)r*r*p1*y)/((double)p2*x+p1*y));
    printf("%.12f",ans);

}


#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int > vi;
typedef vector<long long> vll;

int main()
{
   int a;
   cin>>a;
   vi va(a);
   int r=-1;
   for(int i=0;i<a;i++){
    cin>>va[i];
    r=max(r,va[i]);
   }
   int b;
   cin>>b;
   vi vb(b);
   int px=-1;
   for(int i=0;i<b;i++){
    cin>>vb[i];
    px=max(px,vb[i]);
   }
   int c;
   cin>>c;
   vi vc(c);
   int p=1000000;
   for(int i=0;i<c;i++){
    cin>>vc[i];
    p=min(p,vc[i]);
   }
   int A,B;
   cin>>A>>B;
   int maxx=-1,minn=1000000;

    for(int j=0;j<b;j++){
        maxx=max(maxx,r*r*px*B);

        }

   for(int i=0;i<b;i++){
    for(int j=0;j<c;j++){
        minn=min(minn,p*A+px*B);
    }
   }
   double answer=0;
   answer=sqrt((double)maxx/minn);
   printf("%.12f",answer);

}


#include <bits/stdc++.h>
using namespace std;
#define l1 long long int

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pair<ll,ll>
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL)

int main()
{

    IO;

       int n;
       cin>>n;
       int ar1[n];
       int r1=0;
       for(int i=0;i<n;i++){
           cin>>ar1[i];
           r1=max(r1,ar1[i]);
       }
       int m;
       cin>>m;
       int ar2[m];
       int p1=0;
       for(int i=0;i<m;i++){
           cin>>ar2[i];
           p1=max(p1,ar2[i]);
       }
       int k;
       cin>>k;
       int p2=INT_MAX;
       int ar3[k];
       for(int i=0;i<k;i++){
           cin>>ar3[i];
           p2=min(p2,ar3[i]);
       }
       int a,b;
       cin>>a>>b;
       float k1=(float)a/b;
       float r2=sqrt((p1*r1*r1)/(float)(p1+k1*p2));
       printf("%.7f",r2);
       //std::cout << r2 << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
#define l1 long long int

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pair<ll,ll>
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL)

int main()
{

    IO;

       int n;
       cin>>n;
       int ar1[n];
       int r1=0;
       for(int i=0;i<n;i++){
           cin>>ar1[i];
           r1=max(r1,ar1[i]);
       }
       int m;
       cin>>m;
       int ar2[m];
       int p1=0;
       for(int i=0;i<m;i++){
           cin>>ar2[i];
           p1=max(p1,ar2[i]);
       }
       int k;
       cin>>k;
       int p2=INT_MAX;
       int ar3[k];
       for(int i=0;i<k;i++){
           cin>>ar3[i];
           p2=min(p2,ar3[i]);
       }
       int a,b;
       cin>>a>>b;
       double k1=(double)a/b;
       double r2=sqrt((p1*r1*r1)/(double)(p1+k1*p2));
       printf("%.12f",r2);
       //std::cout << r2 << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
#define l1 long long int

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pair<ll,ll>
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL)

int main()
{

    IO;

       int n;
       cin>>n;
       int ar1[n];
       int r1=0;
       for(int i=0;i<n;i++){
           cin>>ar1[i];
           r1=max(r1,ar1[i]);
       }
       int m;
       cin>>m;
       int ar2[m];
       int p1=0;
       for(int i=0;i<m;i++){
           cin>>ar2[i];
           p1=max(p1,ar2[i]);
       }
       int k;
       cin>>k;
       int p2=INT_MAX;
       int ar3[k];
       for(int i=0;i<k;i++){
           cin>>ar3[i];
           p2=min(p2,ar3[i]);
       }
       int a,b;
       cin>>a>>b;
       float k1=(float)a/b;
       float r2=sqrt((p1*r1*r1)/(float)(p1+k1*p2));
       printf("%.12f",r2);
       //std::cout << r2 << std::endl;
}


#include <bits/stdc++.h>
using namespace std;
#define l1 long long int

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define pp pair<ll,ll>
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL)

int main()
{

    IO;

       int n;
       cin>>n;
       int ar1[n];
       int r1=0;
       for(int i=0;i<n;i++){
           cin>>ar1[i];
           r1=max(r1,ar1[i]);
       }
       int m;
       cin>>m;
       int ar2[m];
       int p1=0;
       for(int i=0;i<m;i++){
           cin>>ar2[i];
           p1=max(p1,ar2[i]);
       }
       int k;
       cin>>k;
       int p2=INT_MAX;
       int ar3[k];
       for(int i=0;i<k;i++){
           cin>>ar3[i];
           p2=min(p2,ar3[i]);
       }
       int a,b;
       cin>>a>>b;
       double k1=(double)a/b;
       double r2=sqrt(((double)p1*r1*r1)/(double)(p1+k1*p2));
       printf("%.12f",r2);
       //std::cout << r2 << std::endl;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define _USE_MATH_DEFINES
/* Definitions of useful mathematical constants
 * M_E        - e
 * M_LOG2E    - log2(e)
 * M_LOG10E   - log10(e)
 * M_LN2      - ln(2)
 * M_LN10     - ln(10)
 * M_PI       - pi
 * M_PI_2     - pi/2
 * M_PI_4     - pi/4
 * M_1_PI     - 1/pi
 * M_2_PI     - 2/pi
 * M_2_SQRTPI - 2/sqrt(pi)
 * M_SQRT2    - sqrt(2)
 * M_SQRT1_2  - 1/sqrt(2)
 */
#include "bits/stdc++.h"
#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, double> pdd;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);

	int x, y, z;
	double A, B;
	vector<double> r1, p1, p2;
	cin >> x;
	int val;
	for(int i=0; i<x; i++) {
		cin >> val;
		r1.pb(val);
	}
	cin >> y;
	for(int i=0; i<y; i++){
		cin >> val;
		p1.pb(val);
	}
	cin >> z;
	for(int i=0; i<z; i++){
		cin >> val;
		p2.pb(val);
	}
	cin >> A >> B;
	double r2 = -2000000000;

	for(int i=0; i<r1.size(); i++){
		for(int j=0; j<p1.size(); j++){
			for(int k=0; k<p2.size(); k++){
				r2 = max(r2, sqrt((M_PI*r1[i]*r1[i])/(A/B*p2[k]/p1[j]*M_PI+M_PI)));
			}
		}
	}
	printf("%.6f",r2);
	return 0;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#define _USE_MATH_DEFINES
/* Definitions of useful mathematical constants
 * M_E        - e
 * M_LOG2E    - log2(e)
 * M_LOG10E   - log10(e)
 * M_LN2      - ln(2)
 * M_LN10     - ln(10)
 * M_PI       - pi
 * M_PI_2     - pi/2
 * M_PI_4     - pi/4
 * M_1_PI     - 1/pi
 * M_2_PI     - 2/pi
 * M_2_SQRTPI - 2/sqrt(pi)
 * M_SQRT2    - sqrt(2)
 * M_SQRT1_2  - 1/sqrt(2)
 */
#include "bits/stdc++.h"
#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<double, double> pdd;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);

	int x, y, z;
	double A, B;
	vector<double> r1, p1, p2;
	cin >> x;
	int val;
	for(int i=0; i<x; i++) {
		cin >> val;
		r1.pb(val);
	}
	cin >> y;
	for(int i=0; i<y; i++){
		cin >> val;
		p1.pb(val);
	}
	cin >> z;
	for(int i=0; i<z; i++){
		cin >> val;
		p2.pb(val);
	}
	cin >> A >> B;
	double r2 = -2000000000;
	sort(r1.begin(),r1.end());

	//for(int i=0; i<r1.size(); i++){
	double r1_ = r1[r1.size()-1];
		for(int j=0; j<p1.size(); j++){
			for(int k=0; k<p2.size(); k++){
				r2 = max(r2, sqrt((M_PI*r1_*r1_)/(A/B*p2[k]/p1[j]*M_PI+M_PI)));
			}
		}
	//}
	printf("%.6f",r2);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,m,k,A,B;
	scanf("%d",&n);
	vector <int> r1 (n);
	for (int &t : r1) scanf("%d",&t);
	scanf("%d",&m);
	vector <int> po (m);
	for (int &t : po) scanf("%d",&t);
	int pi = 5010;
	scanf("%d",&k);
	while (k--) {
		int t;
		scanf("%d",&t);
		pi = min(pi,t);
	}
	scanf("%d%d",&A,&B);
	double r2 = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			double t2 = 1.0*r1[i]*r1[i]*B*po[j];
			t2 /= (A*pi+B*po[j]);
			r2 = max(r2,t2);
		}
	}
	printf("%.7f\n",sqrt(r2));
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,m,k,A,B;
	scanf("%d",&n);
	vector <int> r1 (n);
	for (int &t : r1) scanf("%d",&t);
	scanf("%d",&m);
	vector <int> po (m);
	for (int &t : po) scanf("%d",&t);
	int pi = 5010;
	scanf("%d",&k);
	while (k--) {
		int t;
		scanf("%d",&t);
		pi = min(pi,t);
	}
	scanf("%d%d",&A,&B);
	double r2 = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			double t2 = r1[i]*r1[i]*B*po[j];
			t2 /= (A*pi+B*po[j]);
			r2 = max(r2,t2);
		}
	}
	printf("%.7f\n",sqrt(r2));
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
	int n,m,k,A,B;
	scanf("%d",&n);
	vector <int> r1 (n);
	for (int &t : r1) scanf("%d",&t);
	scanf("%d",&m);
	vector <int> po (m);
	for (int &t : po) scanf("%d",&t);
	scanf("%d",&k);
	vector <int> pi (k);
	for (int &t : pi) scanf("%d",&t);
	sort(pi.begin(),pi.end());
	scanf("%d%d",&A,&B);
	double r2 = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) {
			double t2 = 0;
			int mn = 0, mx = k-1;
			while (mn <= mx) {
				int md = (mn+mx)/2;
				double t = r1[i]*r1[i]*B*po[j];
				t /= (A*pi[md]+B*po[j]);
				if (t < double(r1[i]*r1[i])) {
					t2 = t;
					mx = md-1;
				}
				else mn = md+1;
			}

			r2 = max(r2,t2);
		}
	}
	printf("%.7f\n",sqrt(r2));
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, m, k;
	double r1 = -DBL_MAX, p1 = -DBL_MAX, p2 = DBL_MAX;
	double a, b, r2;
	double x[n], y[m], z[k];
	cin>>n;
	for(int i = 0; i<n; i++){
		cin>>x[i];
		r1 = max(r1, x[i]);
	}
	cin>>m;
	for(int i = 0; i<m; i++){
		cin>>y[i];
		p1 = max(p1, y[i]);
	}
	cin>>k;
	for(int i = 0; i<k; i++){
		cin>>z[i];
		p2 = min(p2, z[i]);
	}
	cin>>a>>b;
	double c = b/a, d = p1/p2;
	r2 = ((c*d)/(1+c*d))*r1*r1;
	cout<<setprecision(12)<<fixed<<sqrt(r2)<<"\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	int n, m, k;
	int r1 = INT_MIN, p1 = INT_MIN, p2 = INT_MAX;
	double a, b, r2;
	int x[n], y[m], z[k];
	scanf("%d",&n);
	for(int i = 0; i<n; i++){
		scanf("%d",&x[i]);
		r1 = max(r1, x[i]);
	}
	scanf("%d",&m);
	for(int i = 0; i<m; i++){
		scanf("%d",&y[i]);
		p1 = max(p1, y[i]);
	}
	scanf("%d",&k);
	for(int i = 0; i<k; i++){
		scanf("%d",&z[i]);
		p2 = min(p2, z[i]);
	}
	scanf("%lf %lf",&a, &b);
	double c = b/a, d = ((double)p1/(double)p2), e = double(r1*r1);
	r2 = ((c*d)/(1+c*d))*e;
	//cout<<c<<" "<<d<<" "<<e<<"**\n";
	printf("%0.12f",sqrt(r2));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	// your code goes here
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, m, k;
	int r1 = INT_MIN, p1 = INT_MIN, p2 = INT_MAX;
	double a, b, r2;
	int x[n], y[m], z[k];
	cin>>n;
	for(int i = 0; i<n; i++){
		cin>>x[i];
		r1 = max(r1, x[i]);
	}
	cin>>m;
	for(int i = 0; i<m; i++){
		cin>>y[i];
		p1 = max(p1, y[i]);
	}
	cin>>k;
	for(int i = 0; i<k; i++){
		cin>>z[i];
		p2 = min(p2, z[i]);
	}
	cin>>a>>b;
	double c = b/a, d = ((double)p1/(double)p2), e = double(r1*r1);
	r2 = ((c*d)/(1+c*d))*e;
	//cout<<c<<" "<<d<<" "<<e<<"**\n";
	cout<<setprecision(12)<<fixed<<sqrt(r2)<<"\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

vector<int> allP1;

int main(){
    int n;
    scanf("%d", &n);

    int mxOuter = 0;
    int mnp2 = 0x3f3f3f3f;

    while(n--){
        int x;
        scanf("%d", &x);
        mxOuter = max(mxOuter, x);
    }

    int m;
    scanf("%d", &m);
    while(m--){
        int x;
        scanf("%d", &x);
        allP1.push_back(x);
    }

    int k;
    scanf("%d", &k);
    while(k--){
        int x;
        scanf("%d", &x);
        mnp2 = min(mnp2, x);
    }

    int a, b;
    scanf("%d%d", &a,&b);

    double ans = 0;
    for(int p1: allP1){
        double possAns = sqrt(b*p1*pow(mxOuter, 2) / (a*mnp2 + b*p1));
        ans = max(possAns, ans);
    }

    printf("%.12f", ans);

}


#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    scanf("%d", &n);

    int mxOuter = 0;
    int mxp1 = 0;
    int mnp2 = 0x3f3f3f3f;

    while(n--){
        int x;
        scanf("%d", &x);
        mxOuter = max(mxOuter, x);
    }

    int m;
    scanf("%d", &m);
    while(m--){
        int x;
        scanf("%d", &x);
        mxp1 = max(mxp1, x);
    }

    int k;
    scanf("%d", &k);
    while(k--){
        int x;
        scanf("%d", &x);
        mnp2 = min(mnp2, x);
    }

    int a, b;
    scanf("%d%d", &a,&b);

    double ans = sqrt(b*mxp1*pow(mxOuter, 2) / (a*mnp2 + b*mxp1));

    printf("%.12f", ans);

}


#include <bits/stdc++.h>

using namespace std;

const int nMax = 5005;

int vr1[nMax], vp1[nMax], vp2[nMax], n, m, kk, a, b;

double res(int r1, int p1, int p2){
    return ((double)r1*sqrt(b*p1))/sqrt(a*p2+b*p1);
}

int main(){
//    freopen("date.in", "r", stdin);
//    freopen("date.out", "w", stdout);

    cin >> n;
    for (int i=0; i<n; i++) cin >> vr1[i];
    sort(vr1, vr1+n);

    cin >> m;
    for (int i=0; i<m; i++) cin >> vp1[i];
    sort(vp1, vp1+m);

    cin >> kk;
    for (int i=0; i<kk; i++) cin >> vp2[i];
    sort(vp2, vp2+kk);

    cin >> a >> b;
    cout << fixed << setprecision(12) << res(vr1[n-1], vp1[m-1], vp2[0]);
}


#include <bits/stdc++.h>

using namespace std;

const int nMax = 5005;

int vr1[nMax], vp1[nMax], vp2[nMax], n, m, kk, a, b;

double res(int r1, int p1, int p2){
    return ((double)r1*sqrt(b*p1))/sqrt(a*p2+b*p1);
}

int main(){
//    freopen("date.in", "r", stdin);
//    freopen("date.out", "w", stdout);

    cin >> n;
    for (int i=0; i<n; i++) cin >> vr1[i];

    cin >> m;
    for (int i=0; i<m; i++) cin >> vp1[i];

    cin >> kk;
    for (int i=0; i<kk; i++) cin >> vp2[i];

    cin >> a >> b;

    double maxR2=0;
    for (int i=0; i<n; i++){
        for (int j=0; j<m; j++){
            for (int k=0; k<kk; k++){
                maxR2 = max(maxR2, res(vr1[i], vp1[j], vp2[k]));
            }
        }
    }
    cout << fixed << setprecision(12) << maxR2;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
ll mod=1e9+0LL;
ll MOD=1e18+0LL;
ll md=1000000007;

const double PI=acos(-1);

typedef vector<int> vi;
typedef pair<int,int> pii;

#define     sz(v)       ((int)((v).size()))
#define     all(v)      ((v).begin()),((v).end())
#define     pb           push_back
#define     ff           first
#define     ss           second
#define     line         printf("\n")
#define     gap          ' '
#define     ctn          continue;
#define     linebreak    printf("******************************\n")
ll poW(ll a ,ll n)
{
    if(n==0) return 1;
    if(n%2==0)
    {
        ll b=poW(a,n/2);
        return (b*b)%md;
    }
    return (poW(a,n-1)*a)%md;
}
bool cmp(const pii &a,const pii &b)     { if(a.ff==b.ff) return a.ss>b.ss;return a.ff<b.ff;}
bool isOdd(int n)       { return (n%2)!=0; }
template <class T>
void printVector(vector <T> &v,string s="")
{
    cout<<s;
    for(int i=0;i<sz(v);i++)
    {
        cout<<v[i]<<gap;
    }
    line;
}

int toInt(string str) {
	int num;
	istringstream iss(str);
	iss>>num; return num;
}

template <class T> string toStr(T par) {
	ostringstream oss;
	oss<<par;
	return oss.str();
}

void sieve(vector<int>&v)
{
    int i,j;
    v.pb(1);
    bool visit[1002];
    memset(visit,0,sizeof(visit));
    for(i=2;i<=1001;i++)
    {
        if(!visit[i])
        {
            for(j=i*i;j<=1001;j+=i)
            {
                visit[j]=1;
            }
            v.pb(i);
            //cout<<i<<gap<<v.back();line;
        }
    }
}
bool isPrime(int x) {
	if (x < 2) return false;
	for (int y = 2; y * y <= x; y++)
		if (x % y == 0)
			return false;
	return true;
}
bool trip(pair<int,pair<int,int> >p,pair<int,pair<int,int> >q)
{
    int id1=p.ff;
    int id2=q.ff;

    int val1=p.ss.ff;
    int val2=q.ss.ff;

    int sid1=p.ss.ss;
    int sid2=q.ss.ss;

    if(id1==id2)
    {
            return sid1<sid2;
    }
    return val1<val2;
}

ll maxSubArraySum(vector<int>&v)
{
    ll sum=0,mx=0;
    for(int i=0;i<sz(v);i++)
    {
        sum=max((ll)v[i],sum+v[i]);
        mx=max(mx,sum);
    }
    return mx;
}
bool cmpl(pair<ll,ll>&p,pair<ll,ll>&q)
{
    ll a=p.ff*2LL;
    ll b=q.ff*2LL;
    return min(a,p.ss)>min(b,q.ss);
}
bool cmpl2(pair<ll,ll>&p,pair<ll,ll>&q)
{
    ll a=p.ff;
    ll b=q.ff;
    return min(a,p.ss)>min(b,q.ss);
}
int bins(int k,int n,vi &v)
{
    int lo=0,hi=n-1;
    while(lo<=hi){
        int mid=(lo+hi+1)/2;
        if(v[mid]==k) return mid;
        if(v[mid]<k){
            lo=mid+1;
        }else hi=mid-1;
    }
    return -1;
}
void printPair(vector<pii >&v){
    for(int i=0;i<sz(v);i++){
        cout<<v[i].ff<<gap<<v[i].ss<<endl;
    }cout<<"-------\n";
}

int main()
{
    int cs=1;
    //scanf("%d",&cs);
    while(cs--)
    {
        int i,j,k,x,y,z;
        cin>>x;
        double r1[x];
        for(i=0;i<x;i++){
            cin>>r1[i];
        }
        cin>>y;
        double p1[y];
        for(i=0;i<y;i++){
            cin>>p1[i];
        }
        cin>>z;
        double p2[z];
        for(i=0;i<z;i++){
            cin>>p2[i];
        }
        double a,b;
        cin>>a>>b;
//        for(i=0;i<x;i++){
//            cout<<r1[i]<<gap;
//        }line;
//                for(i=0;i<y;i++){
//            cout<<p1[i]<<gap;
//        }line;
//                for(i=0;i<z;i++){
//            cout<<p2[i]<<gap;
//        }line;
//        cout<<a<<gap<<b<<endl;
        double d=0.0;
        for(i=0;i<x;i++){
            for(j=0;j<y;j++){
                for(k=0;k<z;k++){
                    double r2=p1[j]*b*r1[i]*r1[i];
                    r2/=((a*p2[k])+(b*p1[j]));
//                    if(r2>d){
//                            cout<<r2<<endl;
//                        cout<<r1[i]<<gap<<p1[j]<<gap<<p2[k]<<endl;
//                    }
                    d=max(d,r2);
                }
            }
        }
        printf("%.12lf",sqrt(d));
    }
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
ll mod=1e9+0LL;
ll MOD=1e18+0LL;
ll md=1000000007;

const double PI=acos(-1);

typedef vector<int> vi;
typedef pair<int,int> pii;

#define     sz(v)       ((int)((v).size()))
#define     all(v)      ((v).begin()),((v).end())
#define     pb           push_back
#define     ff           first
#define     ss           second
#define     line         printf("\n")
#define     gap          ' '
#define     ctn          continue;
#define     linebreak    printf("******************************\n")
ll poW(ll a ,ll n)
{
    if(n==0) return 1;
    if(n%2==0)
    {
        ll b=poW(a,n/2);
        return (b*b)%md;
    }
    return (poW(a,n-1)*a)%md;
}
bool cmp(const pii &a,const pii &b)     { if(a.ff==b.ff) return a.ss>b.ss;return a.ff<b.ff;}
bool isOdd(int n)       { return (n%2)!=0; }
template <class T>
void printVector(vector <T> &v,string s="")
{
    cout<<s;
    for(int i=0;i<sz(v);i++)
    {
        cout<<v[i]<<gap;
    }
    line;
}

int toInt(string str) {
	int num;
	istringstream iss(str);
	iss>>num; return num;
}

template <class T> string toStr(T par) {
	ostringstream oss;
	oss<<par;
	return oss.str();
}

void sieve(vector<int>&v)
{
    int i,j;
    v.pb(1);
    bool visit[1002];
    memset(visit,0,sizeof(visit));
    for(i=2;i<=1001;i++)
    {
        if(!visit[i])
        {
            for(j=i*i;j<=1001;j+=i)
            {
                visit[j]=1;
            }
            v.pb(i);
            //cout<<i<<gap<<v.back();line;
        }
    }
}
bool isPrime(int x) {
	if (x < 2) return false;
	for (int y = 2; y * y <= x; y++)
		if (x % y == 0)
			return false;
	return true;
}
bool trip(pair<int,pair<int,int> >p,pair<int,pair<int,int> >q)
{
    int id1=p.ff;
    int id2=q.ff;

    int val1=p.ss.ff;
    int val2=q.ss.ff;

    int sid1=p.ss.ss;
    int sid2=q.ss.ss;

    if(id1==id2)
    {
            return sid1<sid2;
    }
    return val1<val2;
}

ll maxSubArraySum(vector<int>&v)
{
    ll sum=0,mx=0;
    for(int i=0;i<sz(v);i++)
    {
        sum=max((ll)v[i],sum+v[i]);
        mx=max(mx,sum);
    }
    return mx;
}
bool cmpl(pair<ll,ll>&p,pair<ll,ll>&q)
{
    ll a=p.ff*2LL;
    ll b=q.ff*2LL;
    return min(a,p.ss)>min(b,q.ss);
}
bool cmpl2(pair<ll,ll>&p,pair<ll,ll>&q)
{
    ll a=p.ff;
    ll b=q.ff;
    return min(a,p.ss)>min(b,q.ss);
}
int bins(int k,int n,vi &v)
{
    int lo=0,hi=n-1;
    while(lo<=hi){
        int mid=(lo+hi+1)/2;
        if(v[mid]==k) return mid;
        if(v[mid]<k){
            lo=mid+1;
        }else hi=mid-1;
    }
    return -1;
}
void printPair(vector<pii >&v){
    for(int i=0;i<sz(v);i++){
        cout<<v[i].ff<<gap<<v[i].ss<<endl;
    }cout<<"-------\n";
}

int main()
{
    int cs=1;
    //scanf("%d",&cs);
    while(cs--)
    {
        int i,j,k,x,y,z;
        cin>>x;
        double r1[x];
        for(i=0;i<x;i++){
            cin>>r1[i];
        }
        cin>>y;
        double p1[y];
        for(i=0;i<y;i++){
            cin>>p1[i];
        }
        cin>>z;
        double p2[z];
        for(i=0;i<z;i++){
            cin>>p2[i];
        }
        double a,b;
        cin>>a>>b;
        sort(r1,r1+x);
        sort(p1,p1+y);
        sort(p2,p2+z);
//        for(i=0;i<x;i++){
//            cout<<r1[i]<<gap;
//        }line;
//                for(i=0;i<y;i++){
//            cout<<p1[i]<<gap;
//        }line;
//                for(i=0;i<z;i++){
//            cout<<p2[i]<<gap;
//        }line;
//        cout<<a<<gap<<b<<endl;
        double d=0.0;
//        for(i=0;i<x;i++){
//            for(j=0;j<y;j++){
//                for(k=0;k<z;k++){
                    double r2=p1[y-1]*b*r1[x-1]*r1[x-1];
                    r2/=((a*p2[0])+(b*p1[y-1]));
//                    if(r2>d){
//                            cout<<r2<<endl;
//                        cout<<r1[i]<<gap<<p1[j]<<gap<<p2[k]<<endl;
//                    }
                    d=max(d,r2);
//                }
//            }
//        }
        printf("%.12lf",sqrt(d));
    }
}


#include<iostream>
#include<cmath>
using namespace std;
double a,q,w,e=7000,n;
int main()
{
    cin>>n;

    while(n--)
    cin>>a,q=max(q,a);

    cin>>n;

    while(n--)
    cin>>a,w=max(w,a);

    cin>>n;

    while(n--)
    cin>>a,e=min(a,e);

    cin>>a>>n;
    printf("%f",sqrt((q*q*w*n)/(w*n+e*a)));

}


#include<bits/stdc++.h>
#include<cctype>

using namespace std;

#define ll long long

#define ld long double

#define pll pair<ll,ll>

#define vpll vector<pll>

ll adj[101][101];

int main()
{
    ll n;
    cin >> n;
    ld x[n];
    ll i;
    for(i=0;i<n;i++)
    {
        cin >> x[i];
    }

    ll max=-1;
    for(i=0;i<n;i++)
    {
        if(max<x[i])
        max=x[i];
    }

    ll m;
    cin >> m;
    ld y[m];
    for(i=0;i<m;i++)
    {
        cin >> y[i];
    }

    ll k;
    cin >> k;
    ld z[k];
    for(i=0;i<k;i++)
    {
        cin >> z[i];
    }

    ld A,B;
    cin >> A >> B;

    ld X=A/B;

    ll j,l;
    ld temp;
    ld r1,p1,p2,r2=-1;
    for(i=0;i<n;i++)
    {
        r1=x[i];
        for(j=0;j<m;j++)
        {
            p1=y[j];

            for(l=0;l<k;l++)
            {
                p2=z[l];

                temp=(p1*r1*r1)/(p2*X);
                temp=sqrt(temp);

                if(r2<temp)
                {
                    if(temp<max)
                    r2=temp;
                }
            }
        }
    }

    printf("%.8Lf\n",r2);

    return 0;
}


#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for(ll i = a; i <= b; ++i)
#define fo(i,a,b) for(int i = a; i<= b; ++i)
using namespace std;
using ll=long long;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
ll MD=1000000007;
ll md=998244353;
ll exp(ll a,ll b){ll r=1ll;while(b>0){if(b&1){r=r*(a%md);r=(r+md)%md;}b/=2;a=(a%md)*(a%md);a=(a+md)%md;}return (r+md)%md;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(ll i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
ll n,m,k,maxn=0,A,B;

double fun(int p,int q)
{
	double ans,d=1.0;
	ans=((B*p*d)/(A*q+B*p)*d);
	return ans;
}
int main()
{
     cin>>n;int x[n];rep(i,0,n-1){cin>>x[i]; maxn=Max(maxn,x[i]);}
        cin>>m;int y[m];rep(i,0,m-1)cin>>y[i];
        cin>>k;int z[k];rep(i,0,k-1)cin>>z[i];
       	cin>>A>>B;
        double d=0.0;
        for(int a:y)for(int b:z)
        {
        	double tmp=fun(a,b);
        	if(tmp-d>1e-13)d=tmp;
        }
        cout<<setprecision(12)<<fixed<<sqrt(d)*maxn<<endl;

return 0;}


#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define rep(i,a,b) for(ll i = a; i <= b; ++i)
#define fo(i,a,b) for(int i = a; i<= b; ++i)
using namespace std;
using ll=long long;
typedef vector<ll> vi;
typedef pair<ll,ll> pi;
ll MD=1000000007;
ll md=998244353;
ll exp(ll a,ll b){ll r=1ll;while(b>0){if(b&1){r=r*(a%md);r=(r+md)%md;}b/=2;a=(a%md)*(a%md);a=(a+md)%md;}return (r+md)%md;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll pow_2(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        if(b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }

    return res;
}
bool isPrime(ll a)
{
    for(ll i=3; (i*i)<=a; i+=2)
    {
        if( (a%i)==0 )
            return false;
    }
    if( ( a!=2 ) && ( (a%2)==0 ) )
        return false;
    if( a==1 )
        return false;

    return true;
}
ll Max(ll a,ll b){if(a>b)return a; return b;}
ll n,m,k,maxn=0,A,B;

double fun(int p,int q)
{
	double ans,d=1.0;
	ans=((B*p*d)/(A*q+B*p)*d);
	return ans;
}
int main()
{
     cin>>n;int x[n];rep(i,0,n-1){cin>>x[i]; maxn=Max(maxn,x[i]);}
        cin>>m;int y[m];rep(i,0,m-1)cin>>y[i];
        cin>>k;int z[k];rep(i,0,k-1)cin>>z[i];
       	cin>>A>>B;
        double d=0.0;
        for(int a:y)for(int b:z)
        {
        	double tmp=fun(a,b);
        	if(tmp-d>1e-13)d=tmp;
        }
        cout<<setprecision(12)<<fixed<<sqrt(d)*maxn<<endl;

return 0;}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;cin>>n;
      int r1m=0;
    while(n--){
        int a;cin>>a;
        r1m=max(r1m,a);
    }
int m;cin>>m;
int p1m=0;
while(m--){
    int a;cin>>a;
    p1m=max(p1m,a);
}
int k,p2n=INT_MAX;cin>>k;
while(k--){
    int a;cin>>a;
    p2n=min(p2n,a);
}
int a,b;cin>>a>>b;
cout<<fixed<<setprecision(12)<<sqrt((1.0*b*p1m*r1m*r1m)/(1.0*a*p2n+1.0*b*p1m))<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;cin>>n;
      int r1m=0;
    while(n--){
        int a;cin>>a;
        r1m=max(r1m,a);
    }
int m;cin>>m;
int p1m=0;
while(m--){
    int a;cin>>a;
    p1m=max(p1m,a);
}
int k,p2n=INT_MAX;cin>>k;
while(k--){
    int a;cin>>a;
    p2n=min(p2n,a);
}
int a,b;cin>>a>>b;
cout<<fixed<<setprecision(12)<<sqrt(1.0*(b*p1m*r1m*r1m)/(a*p2n+b*p1m))<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n;cin>>n;
      int r1m=0;
    while(n--){
        int a;cin>>a;
        r1m=max(r1m,a);
    }
int m;cin>>m;
int p1m=0;
while(m--){
    int a;cin>>a;
    p1m=max(p1m,a);
}
int k,p2n=INT_MAX;cin>>k;
while(k--){
    int a;cin>>a;
    p2n=min(p2n,a);
}
int a,b;cin>>a>>b;
cout<<fixed<<setprecision(12)<<sqrt((1.0*b*p1m*r1m*r1m)/(1.0*a*p2n+1.0b*p1m))<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int x[5005], y[5005], z[5005];
int maxx=0, maxy=0, minz=50000;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x[i];
		maxx=max(maxx,x[i]);
	}

	int m;
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>y[i];
		maxy=max(maxy, y[i]);
	}

	int k;
	cin>>k;
	for(int i=1;i<=k;i++){
		cin>>z[i];
		minz=min(minz, z[i]);
	}

	int a,b;
	cin>>a>>b;

	double ans=0.0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			double tmp = x[i]*sqrt((b*y[j])/(a*minz + b*y[j] + .0));
			if(tmp-ans>0.0000001) ans=tmp;
		}
	}

	cout<<setprecision(12)<<fixed<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int x[5005], y[5005], z[5005];
int maxx=0, maxy=0, minz=50000;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x[i];
		maxx=max(maxx,x[i]);
	}

	int m;
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>y[i];
		maxy=max(maxy, y[i]);
	}

	int k;
	cin>>k;
	for(int i=1;i<=k;i++){
		cin>>z[i];
		minz=min(minz, z[i]);
	}

	int a,b;
	cin>>a>>b;

	double ans=0.0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			double tmp = x[i]*sqrt((b*maxy)/(a*z[j] + b*maxy + .0));
			if(tmp-ans>0.0000001) ans=tmp;
		}
	}

	cout<<setprecision(12)<<fixed<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int x[5005], y[5005], z[5005];

int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x[i];
	}

	int m;
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>y[i];
	}

	int k;
	cin>>k;
	for(int i=1;i<=k;i++){
		cin>>z[i];
	}

	int a,b;
	cin>>a>>b;

	double ans=0.0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			for(int l=1;l<=k;l++){
				double tmp = x[i]*sqrt((b*y[j])/(a*z[l] + b*y[j] + .0));
				if(tmp-ans>0.0000001) ans=tmp;
			}
		}
	}

	cout<<setprecision(12)<<fixed<<ans<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int x[5005], y[5005], z[5005];
int maxx=0, maxy=0, minz=50000;
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>x[i];
		maxx=max(maxx,x[i]);
	}

	int m;
	cin>>m;
	for(int i=1;i<=m;i++){
		cin>>y[i];
		maxy=max(maxy, y[i]);
	}

	int k;
	cin>>k;
	for(int i=1;i<=k;i++){
		cin>>z[i];
		minz=min(minz, z[i]);
	}

	int a,b;
	cin>>a>>b;

/*	double ans=0.0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			double tmp = x[i]*sqrt((b*y[j])/(a*minz + b*y[j] + .0));
			if(tmp-ans>0.0000001) ans=tmp;
		}
	}*/

	cout<<setprecision(12)<<fixed<<maxx*sqrt((b*maxy)/(a*minz + b*maxy + .0))<<endl;
	return 0;
}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  return a.F>b.F;
}

void solve(int t){

	int n,m,k,A,B;
	cin>>n;double r1[n];input(r1,n);
	cin>>m; double p1[m];input(p1,m);
	cin>>k; double p2[k]; input(p2,k);
	cin>>A>>B;

	double r2=0;

	sort(r1,r1+n);
	sort(p1,p1+m);
	sort(p2,p2+k);

	double val = (r1[n-1]*r1[n-1])/( A*p2[0]/(B*p1[m-1]) + 1 );
	r2 = max(r2,sqrt(val));

	cout<<fixed<<setprecision(12)<<r2;

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include<bits/stdc++.h>

#define ll            long long
#define pb            push_back
#define si            set <int>
#define F             first
#define S             second
#define mii           map<int ,int >
#define msi           map<string,int >
#define mis           map<int , string>
#define fr(i,a,b)     for(int  i=a;i<=b;i++)
#define loop(i,n)     for(int i=0;i<n;i++)
#define all(v)        v.begin(),v.end()
#define vi            vector<int >
#define vpi           vector<pair<int , int >>
#define vs            vector<string>
#define sz(x)         (int )x.size()
#define M             1000000007
#define mp            make_pair
#define input(arr,n)  loop(i,n) cin>>arr[i]
#define output(arr,n) loop(i,n) cout<<arr[i]<<" "
#define mod           998244353
#define sof           sizeof

using namespace std;

int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a, int b){
	return (a*b)/gcd(a,b);
}

bool comp(const pair<int,int> &a,const pair<int,int> &b){
  return a.F>b.F;
}

void solve(int t){

	int n,m,k,A,B;
	cin>>n;double r1[n];input(r1,n);
	cin>>m; double p1[m];input(p1,m);
	cin>>k; double p2[k]; input(p2,k);
	cin>>A>>B;

	double r2=0;
	loop(i,n){
		loop(j,m){
			loop(r,k){
				double val = (r1[i]*r1[i])/( A*p2[r]/(B*p1[j]) + 1 );
				r2 = max(r2,sqrt(val));
			}
		}
	}
	cout<<fixed<<setprecision(12)<<r2;

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

	//if(sieve[31]) cout<<"chal rha";
	int t;
   	t=1;
    	//cin>>t;
    	loop(i,t){

     		solve(i);
    	}

    	return 0;

}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n,m,l,i,A,B,j,k;
	double ma,ans = 0.0;
	cin >> n;
	int a[n];
	for (i=0;i<n;i++)
	 cin >> a[i];
	cin >> m ;
	int b[m];
	for (i=0;i<m;i++)
	 cin >>  b[i];
	cin >> l;
	int c[l];
	for (i=0;i<l;i++)
	 cin >> c[i];
	cin >> A >> B;

	for (i=0;i<n;i++)
	 {
	     for (j=0;j<m;j++)
	     {
	         for (k=0;k<l;k++)
	         {
	            ma = sqrt(((double)(B*b[j]*a[i]*a[i]))/(A*c[k] + B*b[j]));
	            ans = max (ma,ans);
	         }
	     }
	 }
	 cout << fixed << setprecision(12) << ans;

}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n,m,l,i,A,B,j,k,m1;
	double ma,ans = 0.0;
	cin >> n;
	int a[n];
	for (i=0;i<n;i++)
	 {
	     cin >> a[i];
	     m1 = max(m1,a[i]);
	 }

	cin >> m ;
	int b[m];
	for (i=0;i<m;i++)
	 cin >>  b[i];
	cin >> l;
	int c[l];
	for (i=0;i<l;i++)
	 cin >> c[i];
	cin >> A >> B;
	   for (j=0;j<m;j++)
	     {
	         for (k=0;k<l;k++)
	         {
	            ma = sqrt(((double)(B*b[j]*m1*m1))/(A*c[k] + B*b[j]));
	            ans = max (ma,ans);
	         }
	     }

	 cout << fixed << setprecision(12) << ans;

}


#include <bits/stdc++.h>

using namespace std;

int main() {
	int n,m,l,i,A,B,j,k,m1=0;
	double ma,ans = 0.0;
	cin >> n;
	int a[n];
	for (i=0;i<n;i++)
	 {
	     cin >> a[i];
	     m1 = max(m1,a[i]);
	 }

	cin >> m ;
	int b[m];
	for (i=0;i<m;i++)
	 cin >>  b[i];
	cin >> l;
	int c[l];
	for (i=0;i<l;i++)
	 cin >> c[i];
	cin >> A >> B;
	   for (j=0;j<m;j++)
	     {
	         for (k=0;k<l;k++)
	         {
	            ma = sqrt(((double)(B*b[j]*m1*m1))/(A*c[k] + B*b[j]));
	            ans = max (ma,ans);
	         }
	     }

	 cout << fixed << setprecision(12) << ans;

}


#include <bits/stdc++.h>
typedef long long ll;
typedef long l;
using namespace std;

int main() {
	ll n,m,l,i,A,B,j,k,m1=0;
	double ma,ans = 0.0;
	cin >> n;
	ll a[n];
	for (i=0;i<n;i++)
	 {
	     cin >> a[i];
	     m1 = max(m1,a[i]);
	 }

	cin >> m ;
	ll b[m];
	for (i=0;i<m;i++)
	 cin >>  b[i];
	cin >> l;
	ll c[l];
	for (i=0;i<l;i++)
	 cin >> c[i];
	cin >> A >> B;
	   for (j=0;j<m;j++)
	     {
	         for (k=0;k<l;k++)
	         {
	            ma = sqrt(((double)(B*b[j]*m1*m1))/(A*c[k] + B*b[j]));
	            ans = max (ma,ans);
	         }
	     }

	 cout << fixed << setprecision(12) << ans;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long n,m,x,z,y,k,r1=0,p1=0,p2=1e10,a,b;
    scanf("%lld",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&x);
        r1=max(r1,x);

    }
    scanf("%lld",&m);
    for(int i=0;i<m;i++)
    {
        scanf("%lld",&y);
        p1=max(p1,y);
    }
    scanf("%lld",&k);
        for(int i=0;i<k;i++)
        {
            scanf("%lld",&z);
            p2=min(p2,z);
        }

    scanf("%lld%lld",&a,&b);
    cout<<r1<<" "<<p1<<" "<<p2<<endl;
    double u=b*p1;
    double v=a*p2;
    double w=sqrt(u/(u+v));
    double ans=((double)(r1))*w;
    printf("%0.20lf\n",ans);
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long n,m,x,z,y,k,r1=0,p1=0,p2=1e10,a,b;
    scanf("%lld",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&x);
        r1=max(r1,x);

    }
    scanf("%lld",&m);
    for(int i=0;i<m;i++)
    {
        scanf("%lld",&y);
        p1=max(p1,y);
    }
    scanf("%lld",&k);
        for(int i=0;i<k;i++)
        {
            scanf("%lld",&z);
            p2=min(p2,z);
        }

    scanf("%lld%lld",&a,&b);
    cout<<r1<<" "<<p1<<" "<<p2<<endl;
    double u=b*p1;
    double v=a*p2;
    double w=sqrt(u/(u+v));
    double ans=((double)(r1))*w;
    printf("%0.10lf\n",ans);
    return 0;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    double n,m,x,z,y,k,r1=0,p1=0,p2=1e10,a,b;
    scanf("%lf",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%lf",&x);
        r1=max(r1,x);

    }
    scanf("%lf",&m);
    for(int i=0;i<m;i++)
    {
        scanf("%lf",&y);
        p1=max(p1,y);
    }
    scanf("%lf",&k);
        for(int i=0;i<k;i++)
        {
            scanf("%lf",&z);
            p2=min(p2,z);
        }

    scanf("%lf%lf",&a,&b);
    double u=b*p1;
    double v=a*p2;
    double w=sqrt(u/(u+v));
    double ans=((double)(r1))*w;
    printf("%0.15lf\n",ans);
    return 0;

}


#include<bits/stdc++.h>

using namespace std;
int main()
{
    int n,r1=-1,x;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        if(x>r1)
            r1=x;
    }

    int m,p1=-1,y;
    cin>>m;
    for(int i=0;i<m;i++)
    {
        cin>>y;
        if(y>p1)
            p1=y;
    }

    int k,p2=5000,z;
    cin>>k;
    for(int i=0;i<k;i++)
    {
        cin>>z;
        if(z<p2)
            p2=z;
    }

    int A,B;
    cin>>A>>B;

    double r2;

//    cout<<endl<<r1<<" "<<p2<<"  "<<p2<<endl;

    r2=sqrt((B*p1*r1*r1*1.0)/(B*p1+A*p2*1.0));
    cout<<setprecision(12)<<r2<<endl;

}


#include<bits/stdc++.h>

using namespace std;
int main()
{
    int n,r1=-1,x;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        if(x>r1)
            r1=x;
    }

    int m,p1=-1,y;
    cin>>m;
    for(int i=0;i<m;i++)
    {
        cin>>y;
        if(y>p1)
            p1=y;
    }

    int k,p2=5000,z;
    cin>>k;
    for(int i=0;i<k;i++)
    {
        cin>>z;
        if(z<p2)
            p2=z;
    }

    int A,B;
    cin>>A>>B;

    float r2;

//    cout<<endl<<r1<<" "<<p2<<"  "<<p2<<endl;

    r2=sqrt((B*p1*r1*r1*1.0)/(B*p1+A*p2*1.0));
    cout<<setprecision(12)<<r2<<endl;

}


#include<bits/stdc++.h>

using namespace std;
int main()
{
    long long n,r1=-1,x,i;
    cin>>n;
    for( i=0;i<n;i++)
    {
        cin>>x;
        if(x>r1)
            r1=x;
    }

    long long m,p1=-1,y;
    cin>>m;
    for( i=0;i<m;i++)
    {
        cin>>y;
        if(y>p1)
            p1=y;
    }

    long long k,p2=5000,z;
    cin>>k;
    for( i=0;i<k;i++)
    {
        cin>>z;
        if(z<p2)
            p2=z;
    }

    long long A,B;
    cin>>A>>B;

    double r2;

//    cout<<endl<<r1<<" "<<p2<<"  "<<p2<<endl;

    r2=sqrt((B*p1*r1*r1*1.0)/(B*p1+A*p2*1.0));
    cout<<setprecision(16)<<r2<<endl;

}


#include<bits/stdc++.h>

using namespace std;
int main()
{
    int n,r1=-1,x;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        if(x>r1)
            r1=x;
    }

    int m,p1=-1,y;
    cin>>m;
    for(int i=0;i<m;i++)
    {
        cin>>y;
        if(y>p1)
            p1=y;
    }

    int k,p2=5000,z;
    cin>>k;
    for(int i=0;i<k;i++)
    {
        cin>>z;
        if(z<p2)
            p2=z;
    }

    int A,B;
    cin>>A>>B;

    double r2;

//    cout<<endl<<r1<<" "<<p2<<"  "<<p2<<endl;

    r2=sqrt((B*p1*r1*r1*1.0)/(B*p1+A*p2*1.0));
    cout<<setprecision(16)<<r2<<endl;

}


#include<bits/stdc++.h>
#define N 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
typedef long long ll;
bool compare(pair<ll,ll> p1, pair<ll,ll> p2){
    if(p1.first==p2.first){
      return p1.second<p2.second;
    }
    else{
        return p1.first<p2.first;
    }
}
int main(){
                   fastio;
 ll n;
 cin>>n;

 ll r1=INT_MIN;

 while(n--){
 ll r;
 cin>>r;
 r1=max(r1, r);

 }
 ll p1=INT_MIN;
 cin>>n;
  while(n--){
 ll r;
 cin>>r;
 p1=max(p1, r);

 }
 cin>>n;
 ll p2=INT_MAX;
  while(n--){
 ll r;
 cin>>r;
 p2=min(p2, r);

 }
 ll A,B;
 cin>>A>>B;
 //cout<<r1<<" "<<p1<<" "<<p2<<" "<<A<<" "<<B<<endl;
 cout << fixed << setprecision(12) << sqrt((double)r1*r1*B*p1/(A*p2 +B*p1));
return 0;
}


#include<bits/stdc++.h>
#define N 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
typedef long long ll;
bool compare(pair<ll,ll> p1, pair<ll,ll> p2){
    if(p1.first==p2.first){
      return p1.second<p2.second;
    }
    else{
        return p1.first<p2.first;
    }
}
int main(){
                   fastio;
 ll n;
 cin>>n;

 ll r1=INT_MIN;

 while(n--){
 ll r;
 cin>>r;
 r1=max(r1, r);

 }
 ll p1=INT_MIN;
 cin>>n;
  while(n--){
 ll r;
 cin>>r;
 p1=max(p1, r);

 }
 cin>>n;
 ll p2=INT_MAX;
  while(n--){
 ll r;
 cin>>r;
 p2=min(p2, r);

 }
 ll A,B;
 cin>>A>>B;
 cout << fixed << setprecision(6) << sqrt((r1*r1*B*p1)/(A*p2 +B*p1));
return 0;
}


#include<bits/stdc++.h>
#define N 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
typedef long long ll;
bool compare(pair<ll,ll> p1, pair<ll,ll> p2){
    if(p1.first==p2.first){
      return p1.second<p2.second;
    }
    else{
        return p1.first<p2.first;
    }
}
int main(){
                   fastio;
 ll n;
 cin>>n;

 ll r1=INT_MIN;

 while(n--){
 ll r;
 cin>>r;
 r1=max(r1, r);

 }
 ll p1=INT_MIN;
 cin>>n;
  while(n--){
 ll r;
 cin>>r;
 p1=max(p1, r);

 }
 cin>>n;
 ll p2=INT_MAX;
  while(n--){
 ll r;
 cin>>r;
 p2=min(p2, r);

 }
 ll A,B;
 cin>>A>>B;
 cout<<r1<<" "<<p1<<" "<<p2<<" "<<A<<" "<<B<<endl;
 cout << fixed << setprecision(6) << sqrt((double)r1*r1*B*p1/(A*p2 +B*p1));
return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(c) 		 (int)(c).size()
#define all(c) 		 ((c).begin()), ((c).end())
#define FOR(c, s, n) for (int  (c) = (s); (c) < (n); ++(c))
#define LP(c, i)	 for (auto (i) = (c).begin(); (i) != (c).end(); ++(i))

inline double calcR2(int r1, int p1, int p2, int a, int b)
{
	return r1 * sqrt( (double)(b*p1) / (double)(b*p1 + a*p2) );

}

int oo = (int)1e9;

int main()
{
	int n, m, l, a, b;

	cin >> n;

	vector<int> r1(n);
	FOR(i, 0, n) cin >> r1[i];

	cin >> m;

	vector<int> p1(m);
	FOR(i, 0, m) cin >> p1[i];

	cin >> l;

	vector<int> p2(l);
	FOR(i, 0, l) cin >> p2[i];

	cin >> a >> b;

	double ans = -oo;

	FOR(i, 0, n)
	{
		FOR(j, 0, m)
		{
			FOR(k, 0, l)
			{
				double tmp = calcR2(r1[i], p1[j], p2[k], a, b);
				if (tmp > ans) ans = tmp;
			}
		}
	}
	printf("%.12f\n", ans);
}


#include <bits/stdc++.h>

using namespace std;

#define sz(c) 		 (int)(c).size()
#define all(c) 		 ((c).begin()), ((c).end())
#define FOR(c, s, n) for (int  (c) = (s); (c) < (n); ++(c))
#define LP(c, i)	 for (auto (i) = (c).begin(); (i) != (c).end(); ++(i))

inline double calcR2(int r1, int p1, int p2, int a, int b)
{
	return r1 * sqrt( (double)(b*p1) / (double)(b*p1 + a*p2) );
}

int oo = (int)1e9;

int main()
{
	int n, m, l, a, b;
	int r1 = -oo, p1 = -oo, p2 = oo;

	cin >> n;

	FOR(i, 0, n)
	{
		int x;
		cin >> x;
		if (x > r1)
			r1 = x;
	}

	cin >> m;

	FOR(i, 0, m)
	{
		int x;
		cin >> x;
		if (x > p1)
			p1 = x;
	}

	cin >> l;

	FOR(i, 0, l)
	{
		int x;
		cin >> x;
		if (x < p2)
			p2 = x;
	}

	cin >> a >> b;

	double ans = calcR2(r1, p1, p2, a, b);
	cout << fixed << setprecision(12) << ans << endl;
}


#include <bits/stdc++.h>

using namespace std;

#define sz(c) 		 (int)(c).size()
#define all(c) 		 ((c).begin()), ((c).end())
#define FOR(c, s, n) for (int  (c) = (s); (c) < (n); ++(c))
#define LP(c, i)	 for (auto (i) = (c).begin(); (i) != (c).end(); ++(i))

inline double calcR2(int r1, int p1, int p2, int a, int b)
{
	return r1 * sqrt( (double)(b*p1) / (double)(b*p1 + a*p2) );

}

int oo = (int)1e9;

int main()
{
	int n, m, l, a, b;

	cin >> n;

	vector<int> r1(n);
	FOR(i, 0, n) cin >> r1[i];
	sort(all(r1));

	cin >> m;

	vector<int> p1(m);
	FOR(i, 0, m) cin >> p1[i];
	sort(all(p1));

	cin >> l;

	vector<int> p2(l);
	FOR(i, 0, l) cin >> p2[i];
	sort(all(p2));

	cin >> a >> b;

	double ans = calcR2(r1[n-1], p1[m-1], p2[0], a, b);
	cout << fixed << setprecision(12) << ans << endl;
}


#include <bits/stdc++.h>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

double a[8001], b[8001], c[8001], d, e, r1, r2, p1, p2, zn;

int n, m, k, i, j;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    for (i = 1; i <= n; i++) {
        cin >> a[i];

        r1 = max(r1, a[i]);
    }

    cin >> m;

    for (i = 1; i <= m; i++) cin >> b[i];

    cin >> k;

    for (i = 1; i <= k; i++) cin >> c[i];

    cin >> d >> e;

    cout << setprecision(12) << fixed;

    for (i = 1; i <= m; i++)
        for (j = 1; j <= k; j++) {
            p1 = b[i];

            p2 = c[j];

            zn = d * p2 / (e * p1) + 1.;

            r2 = max(r2, sqrt(pow(r1, 2) / zn));
        }

    cout << r2 << endl;

    return 0;
}


#include <bits/stdc++.h>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

double a, b, c, d, e, r1, r2, p1, p2, zn;

int n, m, k, i, j;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    for (i = 1; i <= n; i++) {
        cin >> a;

        r1 = max(r1, a);
    }

    cin >> m;

    for (i = 1; i <= m; i++) {
        cin >> b;

        p1 = max(p1, b);
    }

    cin >> k;

    p2 = 1e9;

    for (i = 1; i <= k; i++) {
        cin >> c;

        p2 = min(p2, c);
    }

    cin >> d >> e;

    cout << setprecision(12) << fixed;

    zn = d * p2 / (e * p1) + 1.;

    r2 = sqrt(pow(r1, 2) / zn);

    cout << r2 << endl;

    return 0;
}


#include <bits/stdc++.h>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

double a[8001], b[8001], c[8001], d, e, r1, r2, p1, p2, m1, m2, zn;

int n, m, k, i, j;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    for (i = 1; i <= n; i++) cin >> a[i];

    cin >> m;

    for (i = 1; i <= m; i++) cin >> b[i];

    cin >> k;

    for (i = 1; i <= k; i++) cin >> c[i];

    cin >> d >> e;

    for (i = 1; i <= n; i++)
        for (j = 1; j <= m; j++) {
            r1 = a[i];

            p1 = b[j];

            m1 = r1 * p1;

            m2 = m1 * e / d;

            zn = max(zn, m2);
        }

    sort(c + 1, c + 1 + k);

    r2 = zn / c[1];

    cout << setprecision(8) << fixed;

    cout << r2 << endl;

    return 0;
}


#include <bits/stdc++.h>

#define x0 abc
#define y0 ABC
#define x1 abcd
#define y1 ABCD
#define xn abcde
#define yn ABCDE

#define fi first
#define se second
#define m_p make_pair

#define p_b push_back
#define po_b pop_back

#define endl '\n'

#define OUT cout << "-------" << endl;

using namespace std;

const long double P = acos(-1);

double a[8001], b[8001], c[8001], d, e, r1, r2, p1, p2, zn;

int n, m, k, i, j;

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    ios::sync_with_stdio(0);
    cin.tie(0);

    cin >> n;

    for (i = 1; i <= n; i++) {
        cin >> a[i];

        r1 = max(r1, a[i]);
    }

    cin >> m;

    for (i = 1; i <= m; i++) cin >> b[i];

    cin >> k;

    for (i = 1; i <= k; i++) cin >> c[i];

    cin >> d >> e;

    cout << setprecision(12) << fixed;

    for (i = 1; i <= m; i++)
        for (j = 1; j <= k; j++) {
            p1 = b[i];

            p2 = c[j];

            zn = d * p2 / (e * p1) + 1.;

            r2 = max(r2, sqrt(pow(r1, 2) / zn));
        }

    cout << r2 << endl;

//    cout << setprecision(10) << fixed;
//
//    cout << (pow(3., 2) - pow(2.683281573000, 2)) / pow(2.683281573000, 2) << endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k;
    double r1=-1,p1=-1,p2=5001,x,y,z;

    cin>>n;
    for(int i=0;i<n;i++)
    {
    	cin>>x;
    	 r1=max(x,r1);
    }
    cin>>m;
       for(int i=0;i<m;i++)
    {
    	cin>>y;
    	 p1=max(y,p1);
    }

     cin>>k;
       for(int i=0;i<k;i++)
    {
    	cin>>z;
    	 p2=min(z,p2);
    }
    double A,B;
    cin>>A>>B;

    double j=(p2*A)/(p1*B),ans=r1/sqrt(j+1);
    printf("%.12lf",ans);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k;
    double r1,p1,p2,x,y,z=10000;

    cin>>n;
    for(int i=0;i<n;i++)
    {
    	cin>>x;
    	 r1=max(x,r1);
    }
    cin>>m;
       for(int i=0;i<m;i++)
    {
    	cin>>y;
    	 p1=max(y,p1);
    }

     cin>>k;
       for(int i=0;i<k;i++)
    {
    	cin>>z;
    	 p2=min(z,p2);
    }
    double A,B;
    cin>>A>>B;

    double j=(p2*A)/(p1*B),ans=r1/sqrt(j+1);
    printf("%.12lf",ans);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k;
    double r1,p1,p2,x=-1,y=-1,z=10000;

    cin>>n;
    for(int i=0;i<n;i++)
    {
    	cin>>x;
    	 r1=max(x,r1);
    }
    cin>>m;
       for(int i=0;i<m;i++)
    {
    	cin>>y;
    	 p1=max(y,p1);
    }

     cin>>k;
       for(int i=0;i<k;i++)
    {
    	cin>>z;
    	 p2=min(z,p2);
    }
    double A,B;
    cin>>A>>B;

    double j=(p2*A)/(p1*B),ans=r1/sqrt(j+1);
    printf("%.12lf",ans);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
double a,b,r1,p1,p2=10000,n,m,k;
int main(){

    // r1 - first part outer radius
    cin>>n;
    while(n--){
        double rad;
        cin>>rad;
        r1=max(r1,rad);
    }

    // p1 - first part density
    cin>>m;
    while(m--){
        double den1;
        cin>>den1;
        p1=max(p1,den1);
    }

    // p2 - second part density
    cin>>k;
    while(k--){
        double den2;
        cin>>den2;
        p2=max(a,den2);
    }
    cin>>a>>b;
    printf("%.8f\n",sqrt((r1*r1*p1*b)/(p1*b+p2*a)));
}


#include<bits/stdc++.h>
using namespace std;
double a,r1,p1,p2=10000,n,m,b;
int main(){

    // r1 - first part outer radius
    cin>>n;
    while(n--){
        double rad;
        cin>>rad;
        r1=max(r1,rad);
    }

    // p1 - first part density
    cin>>m;
    while(m--){
        double den1;
        cin>>den1;
        p1=max(p1,den1);
    }

    // p2 - second part density
    cin>>k;
    while(k--){
        double den2;
        cin>>den2;
        p2=max(a,den2);
    }
    cin>>a>>b;
    printf("%.8f\n",sqrt((r1*r1*p1*b)/(p1*b+p2*a)));
}


#include<bits/stdc++.h>
using namespace std;
double a,b,r1,p1,p2=10000,n,m,k;
int main(){

    // r1 - first part outer radius
    cin>>n;
    while(n--){
        double rad;
        cin>>rad;
        r1=max(r1,rad);
    }

    // p1 - first part density
    cin>>m;
    while(m--){
        double den1;
        cin>>den1;
        p1=max(p1,den1);
    }

    // p2 - second part density
    cin>>k;
    while(k--){
        double den2;
        cin>>den2;
        p2=min(p2,den2);
    }
    cin>>a>>b;
    printf("%.8f\n",r1*sqrt((b*p1)/(b*p1+a*p2)));
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define bug cout<<"The bug is here!!"<<endl;
#define Ayoub cin.tie(0);std :: ios :: sync_with_stdio (false);
using namespace std;

int main()
{
    Ayoub
    double r1=-1.0,p1=-1.0,p2=INT_MAX;
    double A,B;
    int r1n,p1n,p2n;
    cin>>r1n;
    for(int i=0;i<r1n;i++){
        double tmp;
        cin>>tmp;
        r1 = max(r1,tmp);
    }
    cin>>p1n;
    for(int i=0;i<p1n;i++){
        double tmp;
        cin>>tmp;
        p1 = max(p1,tmp);
    }
    cin>>p2n;
    for(int i=0;i<p2n;i++){
        double tmp;
        cin>>tmp;
        p2 = min(p2,tmp);
    }
    cin>>A>>B;
    double pred = A/B;
    cout<<setprecision(12)<<r1*sqrt((B*p1)/((B*p1)+(A*p2)))<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define bug cout<<"The bug is here!!"<<endl;
#define Ayoub cin.tie(0);std :: ios :: sync_with_stdio (false);
using namespace std;

int main()
{
    Ayoub
    double r1=-1.0,p1=-1.0,p2=INT_MAX;
    double A,B;
    int r1n,p1n,p2n;
    cin>>r1n;
    for(int i=0;i<r1n;i++){
        double tmp;
        cin>>tmp;
        r1 = max(r1,tmp);
    }
    cin>>p1n;
    for(int i=0;i<p1n;i++){
        double tmp;
        cin>>tmp;
        p1 = max(p1,tmp);
    }
    cin>>p2n;
    for(int i=0;i<p2n;i++){
        double tmp;
        cin>>tmp;
        p2 = min(p2,tmp);
    }
    cin>>A>>B;
    double pred = A/B;
    cout<<r1<<", "<<p1<<", "<<p2<<endl;
    cout<<r1*sqrt((B*p1)/((B*p1)+(A*p2)))<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define bug cout<<"The bug is here!!"<<endl;
#define Ayoub cin.tie(0);std :: ios :: sync_with_stdio (false);
using namespace std;

int main()
{
    Ayoub
    double r1=-1.0,p1=-1.0,p2=INT_MAX;
    double A,B;
    int r1n,p1n,p2n;
    cin>>r1n;
    for(int i=0;i<r1n;i++){
        double tmp;
        cin>>tmp;
        r1 = max(r1,tmp);
    }
    cin>>p1n;
    for(int i=0;i<p1n;i++){
        double tmp;
        cin>>tmp;
        p1 = max(p1,tmp);
    }
    cin>>p2n;
    for(int i=0;i<p2n;i++){
        double tmp;
        cin>>tmp;
        p2 = min(p2,tmp);
    }
    cin>>A>>B;
    double pred = A/B;
    cout<<r1*sqrt((B*p1)/((B*p1)+(A*p2)))<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	double n, m, k, A, B, t, r;
	vector<double> vec;
	cin >> n;
	double x[int(n)], y[int(m)], z[int(k)];
	for (auto i = 0; i < n; i++) {
		cin >> x[i];
	}
	for (auto i = 0; i < m; i++) {
		cin >> y[i];
	}
	for (auto i = 0; i < k; i++) {
		cin >> z[i];
	}
	cin >> A >> B;
	for (auto i = 0; i < n; i++) {
		for (auto j = 0; j < m; j++) {
			for (auto l = 0; l < k; l++) {
				t = ((B * y[l]) / ((A * z[j]) + (B * y[l]))) * x[i] * x[i];
				r = pow(t, 0.5);
				vec.push_back(r);
			}
		}
	}
	cout << fixed << setprecision(6) << *max_element(vec.begin(), vec.end());

}


#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n, m, k;
	cin >> n;
	double r1 = -1, p1 = -1, p2 = 1e8;
	for (int i = 0; i < n; i++) {
		double x;
		cin >> x;
		r1 = max(r1, x);
	}
	cin >> m;
	for (int i = 0; i < m; i++) {
		double y;
		cin >> y;
		p1 = max(p1, y);
	}
	cin >> k;
	for (int i = 0; i < k; i++) {
		double z;
		cin >> z;
		p2 = min(p2, z);
	}
	int A, B;
	cin >> A >> B;
	double r2 = r1 * sqrt((p1 * B) / ((p2 * A) + (p1 * B)));
	cout << fixed << setprecision(7) << r2;
}


#include<bits/stdc++.h>
#define MOD 1000000007
using namespace std;

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	double n, m, k, A, B, t, r;
	vector<double> vec;
	cin >> n;
	double x[int(n)];
	for (auto i = 0; i < n; i++) {
		cin >> x[i];
	}
	cin >> m;
	double y[int(m)];
	for (auto i = 0; i < m; i++) {
		cin >> y[i];
	}
	cin >> k;
	double z[int(k)];
	for (auto i = 0; i < k; i++) {
		cin >> z[i];
	}
	cin >> A >> B;
	for (auto i = 0; i < n; i++) {
		for (auto j = 0; j < m; j++) {
			for (auto l = 0; l < k; l++) {
				t = ((B * y[j]) / ((A * z[l]) + (B * y[j]))) * x[i] * x[i];
				r = pow(t, 0.5);
				vec.push_back(r);
			}
		}
	}
	cout << fixed << setprecision(6) << *max_element(vec.begin(), vec.end());

}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<set>
#include<iterator>
#include<iomanip>
#include<math.h>
using namespace std;
int a, b;
int n, m, k;
int x[100000], y[100000], z[100000];
int main() {
	cin >> n;
	cout << setprecision(11) << fixed;
	for (int i = 0; i < n; i++) {
		cin >> x[i];
	}
	sort(x, x + n);

	cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> y[i];
	}
	sort(y, y + m);

	cin >> k;

	for (int i = 0; i < k; i++) {
		cin >> z[i];
	}
	sort(z, z + k);
	cin >> a >> b;
	double r1 = x[n - 1];
	double p1 = y[m - 1];
	double p2 = z[0];

	double ans =( b * p1 * r1 * r1)/(a*p2+b*p1);
	cout << sqrt(ans) << endl;
	return 0;
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<set>
#include<iterator>
#include<iomanip>
#include<math.h>
using namespace std;
int a, b;
int n, m, k;
int x[100000], y[100000], z[100000];
int main() {
	cin >> n;
	cout << setprecision(11) << fixed;
	for (int i = 0; i < n; i++) {
		cin >> x[i];
	}
	sort(x, x + n);

	cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> y[i];
	}
	sort(y, y + m);

	cin >> k;

	for (int i = 0; i < k; i++) {
		cin >> z[i];
	}
	sort(z, z + k);
	cin >> a >> b;
	long long r1 = x[n - 1];
	long long p1 = y[m - 1];
	long long p2 = z[0];

	double ans =double(( b * p1 * r1 * r1))/double((a*p2+b*p1));
	cout << sqrt(ans) << endl;
	return 0;
}


#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<set>
#include<iterator>
#include<iomanip>
#include<math.h>
using namespace std;
int a, b;
int n, m, k;
int x[100000], y[100000], z[100000];
int main() {
	cin >> n;
	cout << setprecision(11) << fixed;
	for (int i = 0; i < n; i++) {
		cin >> x[i];
	}
	sort(x, x + n);

	cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> y[i];
	}
	sort(y, y + m);

	cin >> k;

	for (int i = 0; i < k; i++) {
		cin >> z[i];
	}
	sort(z, z + k);
	cin >> a >> b;
	int r1 = x[n - 1];
	int p1 = y[m - 1];
	int p2 = z[0];

	double ans =( double(b * p1 * r1 * r1))/(double(a*p2+b*p1));
	cout << sqrt(ans) << endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef pair<int,int> pr;
typedef double db;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("file.txt","w",stdout);
#else
#endif
    ios::sync_with_stdio(0);
    double n,r1{},r2,p1{},p2{100000005},a,b,x;cin>>n;
    rep(i,0,n)cin>>x,r1=max(r1,x);cin>>n;
    rep(i,0,n)cin>>x,p1=max(p1,x);cin>>n;
    rep(i,0,n)cin>>x;p2=min(p2,x);cin>>a>>b;
    r2=sqrt((b*p1*r1*r1)/(a*p2+b*p1));
    cout<<fixed<<setprecision(12)<<r2<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef pair<int,int> pr;
typedef double db;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("file.txt","w",stdout);
#else
#endif
    ios::sync_with_stdio(0);
    double n,m,k,r1=-1,x,p1=-1,p2=1000000,a,b;cin>>n;
    rep(i,0,n)cin>>x,r1=max(r1,x);cin>>n;
    rep(i,0,n)cin>>x,p1=max(p1,x);cin>>n;
    rep(i,0,n)cin>>x,p2=min(p2,x);cin>>a>>b;
    cout<<fixed<<setprecision(12)<<r1*sqrt((b*p1)/((b*p1+a*p2)));
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sq(double x) {
    return x * x;
}

double sqrt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 25; i++) {
        mid = (l + r) / 2.0;
        if (sq(mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return (sq(r) * B * p1) / (A * p2 + B * p1);
}

double rat(double r, double p1, double x, double p2) {
    return (sq(r) * p1) / (sq(x) * p2);
}

main(){
    int n, m, k;
    double r=0.0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        r=max(r,a[i]);
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }

    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> c[i];
    }

    double ans = 0; cin >> A >> B;
    for (int j = 0; j < m; j++) {
        for (int q = 0; q < k; q++) {
            double  p1 = b[j], p2 = c[q], x = find_x(r, p1, p2);
            ans=max(ans,x);
        }
    }
    cout <<fixed<<setprecision(20)<<sqrt(ans);
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sq(double x) {
    return x * x;
}

double sqrt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 100; i++) {
        mid = (l + r) / 2.0;
        if (sq(mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return (sq(r) * B * p1) / (A * p2 + B * p1);
}

double rat(double r, double p1, double x, double p2) {
    return (sq(r) * p1) / (sq(x) * p2);
}

main(){
    int n, m, k;
    double r=0.0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        r=max(r,a[i]);
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }

    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> c[i];
    }

    double ans = 0; cin >> A >> B;
    for (int j = 0; j < m; j++) {
        for (int q = 0; q < k; q++) {
            double  p1 = b[j], p2 = c[q], x = find_x(r, p1, p2);
            ans=max(ans,x);
        }
    }
    cout <<fixed<<setprecision(20)<<sqrt(ans);
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
#define double long double
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sq(double x) {
    return x * x;
}

double sqrt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 100; i++) {
        mid = (l + r) / 2.0;
        if (sq(mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return (sq(r) * B * p1) / (A * p2 + B * p1);
}

main(){
    int n, m, k;
    double r=0.0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        r=max(r,a[i]);
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }

    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> c[i];
    }

    double ans = 0; cin >> A >> B;
    for (int j = 0; j < m; j++) {
        for (int q = 0; q < k; q++) {
            double  p1 = b[j], p2 = c[q], x = find_x(r, p1, p2);
            ans=max(ans,x);
        }
    }
    cout <<fixed<<setprecision(20)<<sqrt(ans);
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A=4, B=891;

double sqrtt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 1000; i++) {
        mid = (l + r) / 2.0;
        if ((mid*mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return ((r*r) * B * p1) / (A * p2 + B * p1);
}
main(){
    double r1=0.0,p1=0.0,p2=90000.0,x;
    int i,n,m,k;
    cin>>n;
    rep(i,n){
        cin>>x;
        if (x-r1>0.0)r1=x;
    }
    cin>>m;
    rep(i,m){
        cin>>x;
        if (x-p1>0.0)p1=x;
    }
    cin>>k;
    rep(i,k){
        cin>>x;
        if (p2-x>0.0)p2=x;
    }
    cin>>A>>B;
    double ans=find_x(r1,p1,p2);
    cout <<fixed<<setprecision(7)<<sqrtt(ans);
//25012506,2531266
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
#define double long double
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sq(double x) {
    return x * x;
}

double sqrtt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 100; i++) {
        mid = (l + r) / 2.0;
        if (sq(mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return (sq(r) * B * p1) / (A * p2 + B * p1);
}

main(){
    int n, m, k;
    double r=0.0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        r=max(r,a[i]);
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }

    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> c[i];
    }

    double ans = 0; cin >> A >> B;
    for (int j = 0; j < m; j++) {
        for (int q = 0; q < k; q++) {
            double  p1 = b[j], p2 = c[q], x = find_x(r, p1, p2);
            ans=max(ans,x);
        }
    }
    cout <<fixed<<setprecision(20)<<sqrtt(ans);
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sq(double x) {
    return x * x;
}

double sqrt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 25; i++) {
        mid = (l + r) / 2.0;
        if (sq(mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return sqrt((sq(r) * B * p1) / (A * p2 + B * p1));
}

double rat(double r, double p1, double x, double p2) {
    return (sq(r) * p1) / (sq(x) * p2);
}

main(){
    int n, m, k;

    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }

    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> c[i];
    }

    double ans = 0; cin >> A >> B;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            for (int q = 0; q < k; q++) {
                double r = a[i], p1 = b[j], p2 = c[q], x = find_x(r, p1, p2);
                ans=max(ans,x);
            }
        }
    }
    cout <<fixed<<setprecision(20)<<ans;
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sqrtt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 100; i++) {
        mid = (l + r) / 2.0;
        if ((mid*mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double fun(double r1,double p1,double r2,double p2) {
    ret sqrtt((r1*p1)/(r2/p2));
}
main(){
    double r1=0.0,p1=0.0,p2=0.0,x;
    int i,n,m,k;
    cin>>n;
    rep(i,n){
        cin>>x;
        if (x-r1>0.0)r1=x;
    }
    cin>>m;
    rep(i,m){
        cin>>x;
        if (x-p1>0.0)p1=x;
    }
    cin>>k;
    rep(i,k){
        cin>>x;
        if (x-p2>0.0)p2=x;
    }
    cin>>A>>B;
    double l = 0, r = 5000, mid,pr1=A/B;
    for (int i = 0; i < 1000; i++) {
        mid = (l + r) / 2.0;
        double pr2=fun(r1,p1,mid,p2);
        if (pr1-pr2>0.0){
            r=mid;
        }
        else l=mid;
    }
    cout <<fixed<<setprecision(7)<<l;
//25012506,2531266
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A, B;

double sq(double x) {
    return x * x;
}

double sqrt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 25; i++) {
        mid = (l + r) / 2.0;
        if (sq(mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return sqrt((sq(r) * B * p1) / (A * p2 + B * p1));
}

double rat(double r, double p1, double x, double p2) {
    return (sq(r) * p1) / (sq(x) * p2);
}

main(){
    int n, m, k;
    double r=0.0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        r=max(r,a[i]);
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> b[i];
    }

    cin >> k;
    for (int i = 0; i < k; i++) {
        cin >> c[i];
    }

    double ans = 0; cin >> A >> B;
    for (int j = 0; j < m; j++) {
        for (int q = 0; q < k; q++) {
            double  p1 = b[j], p2 = c[q], x = find_x(r, p1, p2);
            ans=max(ans,x);
        }
    }
    cout <<fixed<<setprecision(20)<<ans;
}


#include <bits/stdc++.h>
using namespace std;
#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define OK puts("OK");
#define sz(s) (int)s.size()
#define int long long
#define pii pair<int,int>
#define all(s) s.begin(), s.end()
#define allr(s) s.rbegin(), s.rend()
#define rep(i,n) for (i=0;i<(n);++i)
#define rep1(i,n) for (i=1;i<=(n);++i)
#define ret return
#define nemeshay ios::sync_with_stdio(0),cin.tie(0);
const int N=1e5+12,INF=1e9+7;
const double eps = 1e-8;
double a[N],b[N],c[N], A=4, B=891;

double sqrtt(double x) {
    double l = 0, r = x, mid;
    for (int i = 0; i < 100; i++) {
        mid = (l + r) / 2.0;
        if ((mid*mid) <= x) {
            l = mid;
        } else {
            r = mid;
        }
    }

    return l;
}

double find_x(double r, double p1, double p2) {
    return sqrt((B*p1)/(B*p1+A*p2));
}
main(){
    double r1=0.0,p1=0.0,p2=90000.0,x;
    int i,n,m,k;
    cin>>n;
    rep(i,n){
        cin>>x;
        if (x-r1>0.0)r1=x;
    }
    cin>>m;
    rep(i,m){
        cin>>x;
        if (x-p1>0.0)p1=x;
    }
    cin>>k;
    rep(i,k){
        cin>>x;
        if (p2-x>0.0)p2=x;
    }
    cin>>A>>B;
    double ans=find_x(r1,p1,p2);
    cout <<fixed<<setprecision(7)<<r1*(ans);
//0.0001999
}


#include <bits/stdc++.h>
#include <cmath>
using namespace std;

int main(int argc, char const *argv[])
{
	cin.sync_with_stdio(false);
	int n,m,k;
	int r1=-1;
	int p1=-1;
	int p2=5001;

	cin>>n;
	for (int i = 0; i < n; ++i){
		int x;
		cin>>x;
		if(x>r1)r1=x;
	}
	cin>>m;
	for (int i = 0; i < m; ++i){
		int x;
		cin>>x;
		if(x>p1)p1=x;
	}
	cin>>k;
	for (int i = 0; i < k; ++i){
		int x;
		cin>>x;
		if(x<p2)p2=x;
	}

	int A;int B;
	cin>>A>>B;
	float sol=(float)r1 /(float)sqrt( (float)(A*p2)/(float)(B*p1)+1);
	printf("%0.10f\n",sol);

	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

int main(int argc, char const *argv[])
{
	int n,m,k;
	int r1=-1;
	int p1=-1;
	int p2=5001;

	cin>>n;
	for (int i = 0; i < n; ++i){
		int x;
		cin>>x;
		if(x>r1)r1=x;
	}
	cin>>m;
	for (int i = 0; i < m; ++i){
		int x;
		cin>>x;
		if(x>p1)p1=x;
	}
	cin>>k;
	for (int i = 0; i < k; ++i){
		int x;
		cin>>x;
		if(x<p2)p2=x;
	}

	int A;int B;
	cin>>A>>B;
	float sol=(float)r1 /(float)sqrt( (float)(A*p2)/(float)(B*p1)+1);
	printf("%0.10f\n",sol);

	return 0;
}


#include <bits/stdc++.h>
#include <cmath>
using namespace std;

int main(int argc, char const *argv[])
{
	cin.sync_with_stdio(false)
	int n,m,k;
	int r1=-1;
	int p1=-1;
	int p2=5001;

	cin>>n;
	for (int i = 0; i < n; ++i){
		int x;
		cin>>x;
		if(x>r1)r1=x;
	}
	cin>>m;
	for (int i = 0; i < m; ++i){
		int x;
		cin>>x;
		if(x>p1)p1=x;
	}
	cin>>k;
	for (int i = 0; i < k; ++i){
		int x;
		cin>>x;
		if(x<p2)p2=x;
	}

	int A;int B;
	cin>>A>>B;
	float sol=(float)r1 /(float)sqrt( (float)(A*p2)/(float)(B*p1)+1);
	printf("%0.10f\n",sol);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
#define endl "\n"
#define pll pair<ll, ll>
#define pii pair<int, int>
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vpii vector<pair<int, int>>
#define mems(x, y) memset(x, y, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define forn(i, s, e) for(int i = s; i < (e); ++i)
#define FASTIO                                                                                \
	ios_base::sync_with_stdio(false);                                                              \
	cin.tie(NULL);
#define FILEIO                                                                                \
	freopen("./input.txt", "r", stdin);                                                            \
	freopen("./output.txt", "w", stdout);
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d)                                                                                \
	for(auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); blockTime.second;  \
		debug("%s : %lld ms\n ",                                                                   \
			  d,                                                                                \
			  chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() -   \
														  blockTime.first)                         \
				  .count()),                                                                       \
			 blockTime.second = false)
const int M = 1e9 + 7;

template <class T>
T ABS(const T& x) {
	return x > 0 ? x : -x;
}
ll gcd(ll n1, ll n2) { return n2 == 0 ? ABS(n1) : gcd(n2, n1 % n2); }
ll lcm(ll n1, ll n2) { return n1 == 0 && n2 == 0 ? 0 : ABS(n1 * n2) / gcd(n1, n2); }
ll ceil2(ll a, ll b) { return (a + b - 1) / b; }

int main() {
	FASTIO
#ifdef LOCAL
	FILEIO
#endif
	int n, m, k;
	cin >> n;

	int x[n];
	forn(i, 0, n) cin >> x[i];

	cin >> m;
	int y[m];
	forn(i, 0, m) cin >> y[i];

	cin >> k;
	int z[k];
	forn(i, 0, k) cin >> z[i];

	int A, B;
	cin >> A >> B;
	sort(z, z + k);
	long double ans = -1;
	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < m; ++j) {
			int r1 = x[i], p1 = y[j];

			int l = 0, r = k - 1;
			while(l <= r) {

				int mid = (l + r) / 2;
				int p2 = z[mid];
				long double r2 = sqrt((B * p1 * r1 * r1) / (long double)(A * p2 + B * p1));
				if(r2 >= r1) { l = mid + 1; }
				else {
					ans = max(r2, ans);
					r = mid - 1;
				}
			}
		}
	}
	cout << fixed << setprecision(12) << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
#define endl "\n"
#define pll pair<ll, ll>
#define pii pair<int, int>
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vpii vector<pair<int, int>>
#define mems(x, y) memset(x, y, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define forn(i, s, e) for(int i = s; i < (e); ++i)
#define FASTIO                                                                                \
	ios_base::sync_with_stdio(false);                                                              \
	cin.tie(NULL);
#define FILEIO                                                                                \
	freopen("./input.txt", "r", stdin);                                                            \
	freopen("./output.txt", "w", stdout);
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d)                                                                                \
	for(auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); blockTime.second;  \
		debug("%s : %lld ms\n ",                                                                   \
			  d,                                                                                \
			  chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() -   \
														  blockTime.first)                         \
				  .count()),                                                                       \
			 blockTime.second = false)
const int M = 1e9 + 7;

template <class T>
T ABS(const T& x) {
	return x > 0 ? x : -x;
}
ll gcd(ll n1, ll n2) { return n2 == 0 ? ABS(n1) : gcd(n2, n1 % n2); }
ll lcm(ll n1, ll n2) { return n1 == 0 && n2 == 0 ? 0 : ABS(n1 * n2) / gcd(n1, n2); }
ll ceil2(ll a, ll b) { return (a + b - 1) / b; }

int main() {
	FASTIO
#ifdef LOCAL
	FILEIO
#endif
	int n, m, k;
	cin >> n;

	long double x[n];
	forn(i, 0, n) cin >> x[i];

	cin >> m;
	long double y[m];
	forn(i, 0, m) cin >> y[i];

	cin >> k;
	long double z[k];
	forn(i, 0, k) cin >> z[i];

	long double A, B;
	cin >> A >> B;
	sort(z, z + k);
	long double ans = -1;
	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < m; ++j) {
			long double r1 = x[i], p1 = y[j];

			int l = 0, r = k - 1;
			while(l <= r) {

				int mid = (l + r) / 2;
				long double p2 = z[mid];
				long double r2 = sqrt((B * p1 * r1 * r1) / (A * p2 + B * p1));
				if(r2 >= r1) { l = mid + 1; }
				else {
					ans = max(r2, ans);
					r = mid - 1;
				}
			}
		}
	}
	cout << fixed << setprecision(12) << ans << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
#define endl "\n"
#define pll pair<ll, ll>
#define pii pair<int, int>
#define pb push_back
#define vi vector<int>
#define vl vector<ll>
#define vpii vector<pair<int, int>>
#define mems(x, y) memset(x, y, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define forn(i, s, e) for(int i = s; i < (e); ++i)
#define FASTIO                                                                                \
	ios_base::sync_with_stdio(false);                                                              \
	cin.tie(NULL);
#define FILEIO                                                                                \
	freopen("./input.txt", "r", stdin);                                                            \
	freopen("./output.txt", "w", stdout);
#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d)                                                                                \
	for(auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); blockTime.second;  \
		debug("%s : %lld ms\n ",                                                                   \
			  d,                                                                                \
			  chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() -   \
														  blockTime.first)                         \
				  .count()),                                                                       \
			 blockTime.second = false)
const int M = 1e9 + 7;

template <class T>
T ABS(const T& x) {
	return x > 0 ? x : -x;
}
ll gcd(ll n1, ll n2) { return n2 == 0 ? ABS(n1) : gcd(n2, n1 % n2); }
ll lcm(ll n1, ll n2) { return n1 == 0 && n2 == 0 ? 0 : ABS(n1 * n2) / gcd(n1, n2); }
ll ceil2(ll a, ll b) { return (a + b - 1) / b; }

int main() {
	FASTIO
#ifdef LOCAL
	FILEIO
#endif
	int n, m, k;
	cin >> n;

	int x[n];
	forn(i, 0, n) cin >> x[i];

	cin >> m;
	int y[m];
	forn(i, 0, m) cin >> y[i];

	cin >> k;
	int z[k];
	forn(i, 0, k) cin >> z[i];

	int A, B;
	cin >> A >> B;
	sort(x, x + n);
	sort(y, y + m);
	sort(z, z + k);

	long double ans = (long double)z[0] / y[m - 1];
	ans *= A;
	ans /= B;
	ans += 1;
	ans = 1.0 / ans;
	ans = sqrt(ans);
	ans *= x[n - 1];

	cout << fixed << setprecision(12) << ans << endl;
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    unsigned long long r1=x[n-1];
    unsigned long long p1=y[m-1];
    unsigned long long p2=z[0];
    unsigned long long B1=B*r1*r1*p1;
    unsigned long long B2=(A*p2 + B*p1);
    double r2= sqrt( (double)(B1)/B2  );
    cout<<setprecision(20)<<fixed<<r2;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    int r1=x[n-1];
    int p1=y[m-1];
    int p2=z[0];
    long long B1=B*r1*r1*p1;
    long long B2=(A*p2 + B*p1);
    float r2= sqrt( 1.0*(B1)/B2  );
    cout<<setprecision(20)<<fixed<<r2;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    int r1=x[n-1];
    int p1=y[m-1];
    int p2=z[0];
    unsigned long long B1=B*r1*r1*p1;
    unsigned long long B2=(A*p2 + B*p1);
    double r2= (double)sqrt( (double)(B1)/B2  );
    cout<<setprecision(20)<<fixed<<r2;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    int r1=x[n-1];
    int p1=y[m-1];
    int p2=z[0];
    float r2= sqrt( 1.0*(B*r1*r1*p1)/(A*p2 + B*p1)      );
    cout<<setprecision(20)<<fixed<<r2;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    unsigned long long r1=x[n-1];
    unsigned long long p1=y[m-1];
    unsigned long long p2=z[0];
    unsigned long long B1=B*r1*r1*p1;
    unsigned long long B2=(A*p2 + B*p1);
    long double r2= sqrt( (double)(B1)/B2  );
    cout<<setprecision(20)<<fixed<<r2;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    int r1=x[n-1];
    int p1=y[m-1];
    int p2=z[0];
    cout<<r1<<"  "<<p1<<"  "<<p2<<endl;
    float r2= sqrt( 1.0*(B*r1*r1*p1)/(A*p2 + B*p1)      );
    cout<<setprecision(10)<<fixed<<r2;

}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    int n,m,k,A,B;
    cin>>n; int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    cin>>m; int y[m];
    for(int i=0;i<m;i++)
        cin>>y[i];
    cin>>k; int z[k];
    for(int i=0;i<k;i++)
        cin>>z[i];
    cin>>A>>B;
    sort(x,x+n);
    sort(y,y+m);
    sort(z,z+k);
    int r1=x[n-1];
    int p1=y[m-1];
    int p2=z[0];
    long long B1=B*r1*r1*p1;
    long long B2=(A*p2 + B*p1);
    double r2= (double)sqrt( (double)(B1)/B2  );
    cout<<setprecision(20)<<fixed<<r2;

}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define IOS ios_base::sync_with_stdio(0),cin.tie(0);
#define MOD 1000000007
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define MIN(X,Y) ((X) <= (Y) ? (X) : (Y))
#define MAX(X,Y) ((X) >= (Y) ? (X) : (Y))
#define F first
#define S second
#define pb push_back;
#define mp make_pair

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;

int main(){
    double n,r1=0,p1=0,p2=5000,a,b;
    cin>>n;for(ll i=0;i<n;i++){cin>>a,r1=max(r1,a);}
    cin>>n;for(ll i=0;i<n;i++){cin>>a,p1=max(p1,a);}
    cin>>n;for(ll i=0;i<n;i++){cin>>a,p2=min(p2,a);}
    cin>>a>>b;
    cout<<fixed<<setprecision(8)<<r1*sqrt(b*p1/(a*p2+b*p1))<<endl;
}


#include <stdio.h>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
#define F(W) for(int i(0);i<W;++i)
#define FT(I,W) for(int k(I);k<W;++k)
#define FF(W) for(int j(0);j<W;++j)
#define MX (1<<20)
#define DX (1024)
#define DY (512)
int N,x[MX],y[MX],L,R,T,B,S;
int LR[DX+1],BT[DY+1];
struct it{
    it(int i):i(i){}
    int i;
    bool operator<(const it&r)const{return x[i]+y[i]<x[r.i]+y[r.i];}
};
vector<it> p[DX][DY];
int ftx(int x){
    F(DX)if(LR[i]>x)return i-1;
    return DX-1;
}
int fty(int y){
    F(DY)if(BT[i]>y)return i-1;
    return DY-1;
}
int main(void){
    scanf("%d",&N);
    F(N)scanf("%d%d",x+i,y+i),L=min(L,x[i]),R=max(R,x[i]),T=max(T,y[i]),B=min(B,y[i]);
    R+=DX+1,T+=DY+1;
    int sx((R-L)/DX),sy((T-B)/DY);
    for(int i(L),j(0);j<DX;++j,i+=sx)LR[j]=i;
    for(int k(B),j(0);j<DY;++j,k+=sy)BT[j]=k;
    LR[DX]=R,BT[DY]=T;
    F(N)p[ftx(x[i])][fty(y[i])].push_back(it(i));
    FF(DX)FT(0,DY)sort(p[j][k].begin(),p[j][k].end());
    FF(DX>>1){
        FT(0,DY)for(auto i:p[j<<1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
        for(int k(DY-1);~k;--k)for(auto i:p[(j<<1)+1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
    }
    return 0;
}


#include <stdio.h>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
#define F(W) for(int i(0);i<W;++i)
#define FT(I,W) for(int k(I);k<W;++k)
#define FF(W) for(int j(0);j<W;++j)
#define MX (1<<20)
#define DV (222)
int N,x[MX],y[MX],L,R,T,B,S;
int LR[DV+1],BT[DV+1];
struct it{
    it(int i):i(i){}
    int i;
    bool operator<(const it&r)const{return x[i]+y[i]<x[r.i]+y[r.i];}
};
vector<it> p[DV][DV];
int ftx(int x){
    F(DV)if(LR[i]>x)return i-1;
    return DV-1;
}
int fty(int y){
    F(DV)if(BT[i]>y)return i-1;
    return DV-1;
}
int main(void){
    scanf("%d",&N);
    F(N)scanf("%d%d",x+i,y+i),L=min(L,x[i]),R=max(R,x[i]),T=max(T,y[i]),B=min(B,y[i]);
    if(R-L<DV)R+=DV;
    if(T-B<DV)T+=DV;
    ++R,++T;
    int sx((R-L)/DV),sy((T-B)/DV);
    for(int i(L),j(0);j<30;++j,i+=sx)LR[j]=i;
    for(int i(B),j(0);j<30;++j,i+=sy)BT[j]=i;
    LR[DV]=R,BT[DV]=T;
    F(N)p[ftx(x[i])][fty(y[i])].push_back(it(i));
    FF(DV)FT(0,DV)sort(p[j][k].begin(),p[j][k].end());
    FF(15){
        FT(0,DV)for(auto i:p[j<<1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
        for(int k(DV-1);~k;--k)for(auto i:p[(j<<1)+1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
    }
    return 0;
}


#include <stdio.h>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
#define F(W) for(int i(0);i<W;++i)
#define FT(I,W) for(int k(I);k<W;++k)
#define FF(W) for(int j(0);j<W;++j)
#define MX (1<<20)
#define DX (512)
#define DY (512)
int N,x[MX],y[MX],L(1<<30),R,T,B(1<<30),S;
int LR[DX+1],BT[DY+1];
struct it{
    it(int i):i(i){}
    int i;
    bool operator<(const it&r)const{return x[i]+y[i]<x[r.i]+y[r.i];}
    bool fit(int l,int r,int b,int t)const{return !(x[i]<l||x[i]>r||y[i]<b||y[i]>t);}
//    bool fit(int l,int r,int b,int t)const{
//        printf("[%d,%d] (%d/%d/%d/%d) (%s)\n",x[i],y[i],l,r,b,t,!(x[i]<l||x[i]>r||y[i]<b||y[i]>t)?"YES":"NO");
//        return !(x[i]<l||x[i]>r||y[i]<b||y[i]>t);
//    }
};
vector<it> p[DX][DY];
int ftx(int x){
    F(DX)if(LR[i]>x)return i-1;
    return DX-1;
}
int fty(int y){
    F(DY)if(BT[i]>y)return i-1;
    return DY-1;
}
void init(int lx,int rx,int by,int ty){
    rx+=DX+1,ty+=DY+1;
    int sx((rx-lx)/DX),sy((ty-by)/DY);
    for(int i(L),j(0);j<DX;++j,i+=sx)LR[j]=i;
    for(int k(B),j(0);j<DY;++j,k+=sy)BT[j]=k;
    LR[DX]=rx,BT[DY]=ty;
}
void put(const it &a){
    F(DX)FF(DY)if(a.fit(LR[i],LR[i+1]-1,BT[j],BT[j+1]-1))p[i][j].push_back(a);
}
int main(void){
    scanf("%d",&N);
    F(N)scanf("%d%d",x+i,y+i),L=min(L,x[i]),R=max(R,x[i]),T=max(T,y[i]),B=min(B,y[i]);
    init(L,R,B,T);
//    F(N)put(it(i));
    F(N)p[ftx(x[i])][fty(y[i])].push_back(it(i));
    FF(DX)FT(0,DY)sort(p[j][k].begin(),p[j][k].end());
    FF(DX>>1){
        FT(0,DY)for(auto i:p[j<<1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
        for(int k(DY-1);~k;--k)for(auto i:p[(j<<1)+1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
    }
    return 0;
}


#include <stdio.h>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
#define F(W) for(int i(0);i<W;++i)
#define FT(I,W) for(int k(I);k<W;++k)
#define FF(W) for(int j(0);j<W;++j)
#define MX (1<<17)
int N,x[MX],y[MX],L,R,T,B,S;
int LR[32],BT[32];
vector<int> p[32][32];
int main(void){
    scanf("%d",&N);
    F(N)scanf("%d%d",x+i,y+i),L=min(L,x[i]),R=max(R,x[i]),T=max(T,y[i]),B=min(B,y[i]);
    if(R-L<30)R+=30;
    if(T-B<30)T+=30;
    ++R,++T;
    int sx((R-L)/30),sy((T-B)/30);
    for(int i(L),j(0);j<30;++j,i+=sx)LR[j]=i;
    for(int i(B),j(0);j<30;++j,i+=sy)BT[j]=i;
    LR[30]=R,BT[30]=T;
    F(N)FF(30)FT(0,30)if(x[i]>=LR[j]&&x[i]<LR[j+1]&&y[i]>=BT[k]&&y[i]<BT[k]+1)p[j][k].push_back(i+1);
    FF(15){
        FT(0,30)for(int i:p[j<<1][k])printf("%d%c",i,++S==N?'\n':' ');
        for(int k(29);~k;--k)for(int i:p[(j<<1)+1][k])printf("%d%c",i,++S==N?'\n':' ');
    }
    return 0;
}


#include <stdio.h>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
#define F(W) for(int i(0);i<W;++i)
#define FT(I,W) for(int k(I);k<W;++k)
#define FF(W) for(int j(0);j<W;++j)
#define MX (1<<20)
#define DX (666)
#define DY (30)
int N,x[MX],y[MX],L,R,T,B,S;
int LR[DX+1],BT[DY+1];
struct it{
    it(int i):i(i){}
    int i;
    bool operator<(const it&r)const{return x[i]+y[i]<x[r.i]+y[r.i];}
};
vector<it> p[DX][DY];
int ftx(int x){
    F(DX)if(LR[i]>x)return i-1;
    return DX-1;
}
int fty(int y){
    F(DY)if(BT[i]>y)return i-1;
    return DY-1;
}
int main(void){
    scanf("%d",&N);
    F(N)scanf("%d%d",x+i,y+i),L=min(L,x[i]),R=max(R,x[i]),T=max(T,y[i]),B=min(B,y[i]);
    R+=DX+1,T+=DY+1;
    int sx((R-L)/DX),sy((T-B)/DY);
    for(int i(L),j(0);j<DX;++j,i+=sx)LR[j]=i;
    for(int k(B),j(0);j<DY;++j,k+=sy)BT[j]=k;
    LR[DX]=R,BT[DY]=T;
    F(N)p[ftx(x[i])][fty(y[i])].push_back(it(i));
    FF(DX)FT(0,DY)sort(p[j][k].begin(),p[j][k].end());
    FF(DX>>1){
        FT(0,DY)for(auto i:p[j<<1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
        for(int k(DY-1);~k;--k)for(auto i:p[(j<<1)+1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
    }
    return 0;
}


#include <stdio.h>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;
#define F(W) for(int i(0);i<W;++i)
#define FT(I,W) for(int k(I);k<W;++k)
#define FF(W) for(int j(0);j<W;++j)
#define MX (1<<20)
#define DX (512)
#define DY (25)
int N,x[MX],y[MX],L,R,T,B,S;
int LR[DX+1],BT[DY+1];
struct it{
    it(int i):i(i){}
    int i;
    bool operator<(const it&r)const{return x[i]+y[i]<x[r.i]+y[r.i];}
};
vector<it> p[DX][DY];
int ftx(int x){
    F(DX)if(LR[i]>x)return i-1;
    return DX-1;
}
int fty(int y){
    F(DY)if(BT[i]>y)return i-1;
    return DY-1;
}
int main(void){
    scanf("%d",&N);
    F(N)scanf("%d%d",x+i,y+i),L=min(L,x[i]),R=max(R,x[i]),T=max(T,y[i]),B=min(B,y[i]);
    R+=DX+1,T+=DY+1;
    int sx((R-L)/DX),sy((T-B)/DY);
    for(int i(L),k(B),j(0);j<30;++j,i+=sx,k+=sy)LR[j]=i,BT[j]=k;
    LR[DX]=R,BT[DY]=T;
    F(N)p[ftx(x[i])][fty(y[i])].push_back(it(i));
    FF(DX)FT(0,DY)sort(p[j][k].begin(),p[j][k].end());
    FF(DX>>1){
        FT(0,DY)for(auto i:p[j<<1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
        for(int k(DY-1);~k;--k)for(auto i:p[(j<<1)+1][k])printf("%d%c",i.i+1,++S==N?'\n':' ');
    }
    return 0;
}