#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <list>

using namespace std;

#define X first
#define Y second

typedef long long llong;
typedef long double ldouble;
typedef pair<int, int> pii;

int main()
{
#if 0
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	llong n, sq, sum;
	cin >> n >> sq >> sum;
	llong x = sum - n + 1;
	if (x * x + n - 1 < sq || n > sum) {
		cout << -1;
	} else {
		cout << x << "\n";
		for (int i = 1; i < n; ++i) cout << "1\n";
	}

	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <list>

using namespace std;

#define X first
#define Y second

typedef long long llong;
typedef long double ldouble;
typedef pair<int, int> pii;

int main()
{
#if 0
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	llong n, sq, sum;
	cin >> n >> sq >> sum;
	llong x = sum - n + 1;
	if (x * x + n - 1< sq) {
		cout << -1;
	} else {
		cout << x << "\n";
		for (int i = 1; i < n; ++i) cout << "1\n";
	}

	return 0;
}


#pragma warning (disable : 4996)

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>

#define forn(i , n) for (int i = 0; i < n; ++i)
#define down(i, n) for (int i = n - 1; i >= 0; --i)

using namespace std;

typedef unsigned long long int u64;
typedef long long i64;
typedef vector<i64> vint;
typedef vector<i64> vi64;
typedef pair<int, int> pint;
typedef pair<i64, i64> pi64;

#define FILE_NAME "file"
#define CONTEST "rmq"
#define M_PI 3.14159265358979323846
#define MODULE 1000000007

const i64 inf = 1000000000000000LL;

struct Friend
{
    int tax, gir, pic;
    string name;
    Friend()
    {
        tax = gir = pic = 0;
    }
};

void calc(Friend & f, string n)
{
    vint a;
    forn(i, 3)
    {
        forn(j, 2)
        {
            int k = i * 3 + j;
            a.push_back(n[k] - '0');
        }
    }
    vint b = a;
    sort(a.begin(), a.end(), greater<int>());
    if (b == a && a[0] != a[1] && a[1] != a[2] && a[2] != a[3] && a[3] != a[4] && a[4] != a[5])
    {
        f.pic++;
    }
    else if (a[0] == a[1] && a[1] == a[2] && a[2] == a[3] && a[3] == a[4] && a[4] == a[5])
    {
        f.tax++;
    }
    else
    {
        f.gir++;
    }
}

bool check(char c, string & a)
{
    int l = a.length();
    if (l >= 2)
    {
        if (c == a[l - 1] && c == a[l - 2])
        {
            return false;
        }
    }
    if (l >= 3)
    {
        if (c == a[l - 1] && a[l - 2] == a[l - 3])
            return false;
    }
    return true;
}

int main()
{
    clock_t start = clock();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(15);
    srand(13);
#ifdef FILE_INPUT
    freopen(FILE_NAME ".in", "r", stdin);
    freopen(FILE_NAME ".out", "w", stdout);
#endif
    i64 n, x, y;
    cin >> n >> x >> y;
    x -= n - 1;
    y -= n - 1;
    if (y < 0)
    {
        cout << "-1";
        return 0;
    }
    if (y * y >= x)
    {
        cout << y;
        forn(i, n - 1)
        {
            cout << " 1";
        }
    }
    else
    {
        cout << "-1";
    }
    return 0;
}


#pragma warning (disable : 4996)

#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <assert.h>
#include <stack>
#include <algorithm>
#include <ios>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <queue>
#include <set>
#include <functional>
#include <cmath>
#include <sstream>
#include <map>
#include <memory.h>
#include <stdio.h>
#include <cassert>
#include <string.h>

#define forn(i , n) for (int i = 0; i < n; ++i)
#define down(i, n) for (int i = n - 1; i >= 0; --i)

using namespace std;

typedef unsigned long long int u64;
typedef long long i64;
typedef vector<i64> vint;
typedef vector<i64> vi64;
typedef pair<int, int> pint;
typedef pair<i64, i64> pi64;

#define FILE_NAME "file"
#define CONTEST "rmq"
#define M_PI 3.14159265358979323846
#define MODULE 1000000007

const i64 inf = 1000000000000000LL;

struct Friend
{
    int tax, gir, pic;
    string name;
    Friend()
    {
        tax = gir = pic = 0;
    }
};

void calc(Friend & f, string n)
{
    vint a;
    forn(i, 3)
    {
        forn(j, 2)
        {
            int k = i * 3 + j;
            a.push_back(n[k] - '0');
        }
    }
    vint b = a;
    sort(a.begin(), a.end(), greater<int>());
    if (b == a && a[0] != a[1] && a[1] != a[2] && a[2] != a[3] && a[3] != a[4] && a[4] != a[5])
    {
        f.pic++;
    }
    else if (a[0] == a[1] && a[1] == a[2] && a[2] == a[3] && a[3] == a[4] && a[4] == a[5])
    {
        f.tax++;
    }
    else
    {
        f.gir++;
    }
}

bool check(char c, string & a)
{
    int l = a.length();
    if (l >= 2)
    {
        if (c == a[l - 1] && c == a[l - 2])
        {
            return false;
        }
    }
    if (l >= 3)
    {
        if (c == a[l - 1] && a[l - 2] == a[l - 3])
            return false;
    }
    return true;
}

int main()
{
    clock_t start = clock();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(15);
    srand(13);
#ifdef FILE_INPUT
    freopen(FILE_NAME ".in", "r", stdin);
    freopen(FILE_NAME ".out", "w", stdout);
#endif
    i64 n, x, y;
    cin >> n >> x >> y;
    x -= n - 1;
    y -= n - 1;
    if (y < 1)
    {
        cout << "-1";
        return 0;
    }
    if (y * y >= x)
    {
        cout << y;
        forn(i, n - 1)
        {
            cout << " 1";
        }
    }
    else
    {
        cout << "-1";
    }
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
using namespace std;

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

	int n, x, y, t, a, a0;
	cin >> n >> x >> y;
	a = y / n;
	a0 = y - a * (n - 1);

	if (a0 * a0 + (n - 1) * a * a >= x)
	{
		cout << a0 << endl;
		for (int i = 0; i < n - 1; i++)
			cout << a << endl;
	} else
		cout << -1;
}


#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
using namespace std;

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

	int n, x, y, t, a, a0;
	cin >> n >> x >> y;

	a0 = y - (n - 1);
	a = 1;

	if (a0 * a0 + (n - 1) * a * a >= x && a > 0 && a0 > 0)
	{
		cout << a0 << endl;
		for (int i = 0; i < n - 1; i++)
			cout << a << endl;
	} else
		cout << -1;
}


    #include <iostream>
    #include <string>
    #include <algorithm>
    #include <vector>
    #include <set>
    #include <queue>
    using namespace std;

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

            long long int n, x, y, t, a, a0;
            cin >> n >> x >> y;

            a0 = y - (n - 1);
            a = 1;

            if (a0 * a0 + (n - 1) * a * a >= x && a > 0 && a0 > 0)
            {
                    cout << a0 << endl;
                    for (int i = 0; i < n - 1; i++)
                            cout << a << endl;
            } else
                    cout << -1;
    }


    #include <iostream>
    #include <string>
    #include <algorithm>
    #include <vector>
    #include <set>
    #include <queue>
    using namespace std;

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

            long long int n, x, y, t, a, a0;
            cin >> n >> x >> y;

            a0 = y - (n - 1);
            a = 1;

            if (a0 * a0 + (n - 1) * a * a >= x && a > 0 && a0 > 0)
            {
                    cout << a0 << endl;
                    for (int i = 0; i < n - 1; i++)
                            cout << a << endl;
            } else
                    cout << -1;
    }


#include <iostream>
#include <algorithm>
#include <string.h>
#include <vector>

using namespace std;

int main()
{
	long long x, y;
	int n;

	cin >> n >> x >> y;

	vector <int> ans;
	ans.clear();

	if (n > y)
		cout << -1 << endl;
	else {
		for (int i = 0; i < n - 1; i ++, y --, x --)
			ans.push_back(1);
		ans.push_back(y);
		if (y * y < x)  cout << -1 << endl;
		else {
			for (int i = 0; i < ans.size(); i ++)
				cout << ans[i] << endl;
		}
	}

//	system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int nhap(int a[], int n)
{
	int max = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		max = max >= a[i] ? max : a[i];
	}
	return max;
}
int ss(int a[], int n, int b)
{
	for (int i = 0; i < n; i++)
	{
		if (a[i] == b)
			return 0;
	}
	return 1;
}
void kt(int a[], int b[], int n, int m)
{
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			int	c = a[i] + b[j];
			if (ss(a, n, c) == 1 && ss(b, m, c) == 1)
			{
				cout << a[i] << " " << b[j] << " ";
				return;
			}

		}
	}
}
int main()
{
	int n, m, a[100], b[100];
	cin >> n;
	int max1 = nhap(a, n);
	cin >> m;
	int max2 = nhap(b, m);
	//kt(a,b,n,m);
	cout << max1 << " " << max2;
	int t = 1;
	return 0;
}


#include<iostream>
using namespace std;
void nhap(int a[],int n)
{
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
}
int ss(int a[],int n,int b)
{
	for(int i=0;i<n;i++)
	{
		if(a[i]==b)
			return 0;
	}
	return 1;
}
void kt(int a[],int b[],int n, int m)
{
	for(int i=0;i<n;i++)
	{	int c=0;
		for(int j=0;j<m;j++)
		{
			c=a[i]+b[j];
			if(ss(a,n,c)==1&&ss(b,m,c)==1)
			{
				cout<<a[i]<<" "<<b[j]<<" ";
			}
			break;
		}
		break;
	}
}
int main()
{
	int n, m,a[100],b[100];
	cin >> n;
	nhap(a,n);
	cin >>m;
	nhap(b,m);
	kt(a,b,n,m);
	return 0;

}


#include<iostream>
using namespace std;
int nhap(int a[],int n)
{
	int max=0;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		max=max>=a[i]?max:a[i];
	}
	return max;
}
int ss(int a[],int n,int b)
{
	for(int i=0;i<n;i++)
	{
		if(a[i]==b)
			return 0;
	}
	return 1;
}
void kt(int a[],int b[],int n, int m)
{
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			int	c=a[i]+b[j];
			if(ss(a,n,c)==1&&ss(b,m,c)==1)
			{
				cout<<a[i]<<" "<<b[j]<<" ";
				return;
			}

		}
	}
}
void main()
{
	int n, m,a[100],b[100];
	cin >> n;
	int max1=nhap(a,n);
	cin >>m;
	int max2=nhap(b,m);
	//kt(a,b,n,m);
	cout<< max1+max2;

}


#include<iostream>
using namespace std;
int nhap(int a[],int n)
{
	int max=0;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		max=max>=a[i]?max:a[i];
	}
	return max;
}
int ss(int a[],int n,int b)
{
	for(int i=0;i<n;i++)
	{
		if(a[i]==b)
			return 0;
	}
	return 1;
}
void kt(int a[],int b[],int n, int m)
{
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m;j++)
		{
			int	c=a[i]+b[j];
			if(ss(a,n,c)==1&&ss(b,m,c)==1)
			{
				cout<<a[i]<<" "<<b[j]<<" ";
				return;
			}

		}
	}
}
int main()
{
	int n, m,a[100],b[100];
	cin >> n;
	int max1=nhap(a,n);
	cin >>m;
	int max2=nhap(b,m);
	//kt(a,b,n,m);
	cout<< max1+max2;
	return 0;
}


#include<iostream>
using namespace std;
int main()
{   int temp[201]={0};
    int n, m;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {cin>>a[i];
      temp[a[i]]++;}
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
    {cin>>b[i];
    temp[b[i]]++;}

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {  int sum=a[i]+b[j];
           if(sum<201){
         if(!temp[a[i]+b[j]])
          { cout<<a[i]<<" "<<b[j];
           goto am;}}
           else {cout<<a[i]<<" "<<b[j];
           goto am;}
    }
    }
    am:
    ;

}


#include<iostream>
using namespace std;
int main()
{   int temp[201]={0};
    int n, m;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {cin>>a[i];
      temp[a[i]]++;}
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
    {cin>>b[i];
    temp[b[i]]++;}

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {  int sum=a[i]+b[j];
           if(sum<201){
         if(!temp[a[i]+b[j]])
          { cout<<a[i]<<" "<<b[j];
           goto am;}}

         else cout<<a[i]<<" "<<b[j];
    }
    }
    am:
    ;

}


#include<iostream>
using namespace std;
int main()
{   int temp[201]={0};
    int n, m;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {cin>>a[i];
      temp[a[i]]++;}
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
    {cin>>b[i];
    temp[b[i]]++;}

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {  int sum=a[i]+b[j];
           if(sum<201){
         if(!temp[a[i]+b[j]])
          { cout<<a[i]<<" "<<b[j];
           goto am;}}
    }
    }
    am:
    ;

}


#include<iostream>
using namespace std;
int main()
{   int temp[201]={0};
    int n, m;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {cin>>a[i];
      temp[a[i]]++;}
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
    {cin>>b[i];
    temp[b[i]]++;}

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
         if(!temp[a[i]+b[j]])
          { cout<<a[i]<<" "<<b[j];
           goto am;}
    }
    am:
    ;

}


#include<iostream>
using namespace std;
int main()
{   int temp[201]={0};
    int n, m;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)
    {cin>>a[i];
      temp[a[i]]++;}
    cin>>m;
    int b[m];
    for(int i=0;i<m;i++)
    {cin>>b[i];
    temp[b[i]]++;}

    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
         if(!temp[a[i]+b[j]])
          { cout<<a[i]<<" "<<b[j];
           break;}
    }

}


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int a,b,c[100000],d[100000];

  cin>>a;
  for(int i=0;i<a;i++)
  {
   cin>>c[i];
  }
   cin>>b;
  for(int i=0;i<b;i++)
  {
   cin>>d[i];
  }
  sort(c,c+a);
  sort(d,d+b);
  cout<<c[a-1]<<" "<<d[b-1];


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
  int a,b,c[100000],d[100000];

  cin>>a;
  for(int i=0;i<a;i++)
  {
   cin>>c[i];
  }
   cin>>b;
  for(int i=0;i<b;i++)
  {
   cin>>d[i];
  }
  sort(c,c+a);
  sort(d,d+b);
  {
  cout<<c[a-1]<<" "<<d[b-1];
  }}


#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
  int a,b,c[100000],d[100000];

  cin>>a;
  for(int i=0;i<a;i++)
  {
   cin>>c[i];
  }
   cin>>b;
  for(int i=0;i<b;i++)
  {
   cin>>d[i];
  }
  sort(c,c+a);
  sort(d,d+b);
  {
  cout<<c[a-1]<<" "<<d[b-1];
  }


#include<iostream>
#include<cmath>
using namespace std;
int main()
{
  int a,b,c[100000],d[100000];

  cin>>a;
  for(int i=0;i<n;i++)
  {
   cin>>c[i];
  }
   cin>>b;
  for(int i=0;i<n;i++)
  {
   cin>>d[i];
  }
  sort(c,c+n);
  sort(d,d+n);
  cout<<c[n-1]<<" "<<d[n-1];


#include<iostream>
#include<cmath>
using namespace std;
{
  int a,b,c[100000],d[100000];

  cin>>a;
  for(int i=0;i<n;i++)
  {
   cin>>c[i];
  }
   cin>>b;
  for(int i=0;i<n;i++)
  {
   cin>>d[i];
  }
  sort(c,c+n);
  sort(d,d+n);
  cout<<c[n-1]<<" "<<d[n-1];


#include<bits/stdc++.h>
using namespace std;
int i,j;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    int n,m,flag = 0;
    cin>>n;
    int a[n],A[300] = { };
    for(i=0;i<n;i++)
       {
           cin>>a[i];
           A[a[i]]=1;
       }
    cin>>m;
    int b[m];
    for(i=0;i<m;i++)
        {
            cin>>b[i];
            A[b[i]]=1;
        }
    int x = 0,y = 0;
    for(i=0;i<n;i++)
        {for(j=0;j<m;j++)
            {
                if(A[a[i]+b[j]]!=1)
                    {
                        x = a[i];
                        y = b[i];
                        flag = 1;
                        break;
                    }

            }
            if(flag == 1)
                break;
        }
    cout<<x<<" "<<y<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,j;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    int n,m,flag = 0;
    cin>>n;
    int a[n],A[300] = { };
    for(i=0;i<n;i++)
       {
           cin>>a[i];
           A[a[i]]=1;
       }
    cin>>m;
    int b[m];
    for(i=0;i<m;i++)
        {
            cin>>b[i];
            A[b[i]]=1;
        }
    int x = 0,y = 0;
    for(i=0;i<20;i++)
        cout<<A[i]<<" ";
    for(i=0;i<n;i++)
        {for(j=0;j<m;j++)
            {
                if(A[a[i]+b[j]]!=1)
                    {
                        x = a[i];
                        y = b[j];
                        flag = 1;
                        break;
                    }

            }
            if(flag == 1)
                break;
        }
    cout<<x<<" "<<y<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,j;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    int n,m,flag = 0;
    cin>>n;
    int a[n],A[300] = { };
    for(i=0;i<n;i++)
       {
           cin>>a[i];
           A[a[i]]=1;
       }
    cin>>m;
    int b[m];
    for(i=0;i<m;i++)
        {
            cin>>b[i];
            A[b[i]]=1;
        }
    int x = 0,y = 0;
    for(i=0;i<20;i++)
        cout<<A[i]<<" ";
    for(i=0;i<n;i++)
        {for(j=0;j<m;j++)
            {
                if(A[a[i]+b[j]]!=1)
                    {
                        x = a[i];
                        y = b[i];
                        flag = 1;
                        break;
                    }

            }
            if(flag == 1)
                break;
        }
    cout<<x<<" "<<y<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,j;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    int n,m,flag = 0;
    cin>>n;
    int a[n],A[300];
    for(i=0;i<n;i++)
       {
           cin>>a[i];
           A[a[i]]=1;
       }
    cin>>m;
    int b[m];
    for(i=0;i<m;i++)
        {
            cin>>b[i];
            A[b[i]]=1;
        }
    int x = 0,y = 0;
    for(i=0;i<n;i++)
        {for(j=0;j<m;j++)
            {
                if(A[a[i]+b[j]]!=1)
                    {
                        x = a[i];
                        y = b[i];
                        flag = 1;
                        break;
                    }

            }
            if(flag == 1)
                break;
        }
    cout<<x<<" "<<y<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,j;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    int n,m,flag = 0;
    cin>>n;
    int a[n],A[300] = { };
    for(i=0;i<n;i++)
       {
           cin>>a[i];
           A[a[i]]=1;
       }
    cin>>m;
    int b[m];
    for(i=0;i<m;i++)
        {
            cin>>b[i];
            A[b[i]]=1;
        }
    int x = 0,y = 0;

    for(i=0;i<n;i++)
        {for(j=0;j<m;j++)
            {
                if(A[a[i]+b[j]]!=1)
                    {
                        x = a[i];
                        y = b[j];
                        flag = 1;
                        break;
                    }

            }
            if(flag == 1)
                break;
        }
    cout<<x<<" "<<y<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int i,j;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    int n,m,flag = 0;
    cin>>n;
    int a[n],A[401] = { };
    for(i=0;i<n;i++)
       {
           cin>>a[i];
           A[a[i]]=1;
       }
    cin>>m;
    int b[m];
    for(i=0;i<m;i++)
        {
            cin>>b[i];
            A[b[i]]=1;
        }
    int x = 0,y = 0;

    for(i=0;i<n;i++)
        {for(j=0;j<m;j++)
            {
                if(A[a[i]+b[j]]!=1)
                    {
                        x = a[i];
                        y = b[j];
                        flag = 1;
                        break;
                    }

            }
            if(flag == 1)
                break;
        }
    cout<<x<<" "<<y<<endl;
    return 0;
}


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

int a[109], b[109];
int n, m;
map<int, bool>mp;

int main(){
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    cin>>m;
    for(int i=0; i<m; i++)
        cin>>b[i];
    sort(a, a+n);
    sort(b, b+m);
    cout << a[n-1] << b[m-1] << endl;
    return 0;
}


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

int a[109], b[109];
int n, m;
map<int, bool>mp;

int main(){
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    cin>>m;
    for(int i=0; i<m; i++)
        cin>>b[i];
    sort(a, a+n);
    sort(b, b+m);
    cout << a[n-1] << " " << b[m-1] << endl;
    return 0;
}


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

int a[109], b[109];
int n, m;
map<int, bool>mp;

int main(){
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>a[i];
    cin>>m;
    for(int i=0; i<m; i++){
        cin>>b[i];
    sort(a, a+n);
    sort(b, b+m);
    cout << a[n-1] + b[m-1] << endl;
    return 0;
}


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

int a[109], b[109];
int n, m;
map<int, bool>mp;

int main(){
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    cin>>m;
    for(int i=0; i<m; i++)
        cin>>b[i];
    sort(a, a+n);
    sort(b, b+m);
    cout << a[n-1] + b[m-1] << endl;
    return 0;
}


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

int a[109], b[109];
int n, m;
map<int, bool>mp;
int main(){
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>a[i];
        mp[a[i]]==1;
    }
    cin>>m;
    for(int i=0; i<m; i++){
        cin>>b[i];
        mp[b[i]]==1;
    }
    for(int i=0; i<n; i++)
        for(int j=0; j<m; j++) if(mp[a[i]+b[j]]==0)
        {
            cout << a[i] << " " << b[j] << endl;
            return 0;
        }
}


#include<bits/stdc++.h>
using namespace std;
void choose(int n,int m,int input1[],int input2[])
{
	int count=0;
    for(int i=0;i<n;i++)
	{
	   for(int j=0;j<m;j++)
	   {
	   int sum=input1[i]+input2[j];
	   	for(int i=0,j=0;i<n,j<m;i++,j++)
	   	{
	   		 if(sum==input1[i] && sum==input2[j])
				break;
				count++;
		}
		if(count==max(n,m))
		{
			cout<<input1[i]<<" "<<input2[j];
		}
	   }
	}
}
int main()
{
	int n,m;
	cin>>n;
	int* input1=new int[n];
	for(int i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	int* input2=new int[m];
	for(int i=0;i<m;i++)
	{
		cin>>input2[i];
	}
	choose(n,m,input1,input2);
}


#include<bits/stdc++.h>
#include<set>
using namespace std;
void sum(int n,int m,int input1[],int input2[])
{
	set<int>s;
	set<int> :: iterator it;
	int sum=0;
	for(int i=0;i<n;i++)
	{
		s.insert(input1[i]);
	}
	for(int i=0;i<m;i++)
	{
		s.insert(input2[i]);
	}
	for(int i=0;i<n;i++)
	{
		for(int j=m-1;j>=0;j--)
		{
			sum=input1[i]+input2[j];

				if(s.find(sum)==s.end())
				{
					cout<<input1[i]<<" "<<input2[j];
					return;
				}

		}
	}
}
int main()
{
	int n,m;
	cin>>n;
	int input1[n];
	for(int i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	int input2[m];
	for(int i=0;i<m;i++)
	 {
	 	cin>>input2[i];
	 }
	sum(n,m,input1,input2);
}


#include<bits/stdc++.h>
using namespace std;
void choose(int n,int m,int input1[],int input2[])
{
	int count=0;
    for(int i=0;i<n;i++)
	{
	   for(int j=m-1;j>=0;j--)
	   {
	   int sum=input1[i]+input2[j];
	   	for(int i=0,j=0;i<n,j<m;i++,j++)
	   	{
	   		 if(sum==input1[i] || sum==input2[j])
				break;
				count++;
		}
		if(count==max(n,m))
		{
			cout<<input1[i]<<" "<<input2[j];
		}
	   }
	}
}
int main()
{
	int n,m;
	cin>>n;
	int* input1=new int[n];
	for(int i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	int* input2=new int[m];
	for(int i=0;i<m;i++)
	{
		cin>>input2[i];
	}
	choose(n,m,input1,input2);
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
void choose(ll n,ll m,ll input1[],ll input2[])
{
	ll count=0;
	ll flag=0;
    for(ll i=0;i<n;i++)
	{
	   for(ll j=m-1;j>=0;j--)
	   {
	   ll sum=input1[i]+input2[j];
	   	for(ll i=0;i<n;i++)
	   	{
	   		 if(sum==input1[i] )
	   		 {
	   		 	flag=1;
				break;
			 }
				count++;
		}
		if(flag==0)
		{
		for(ll j=0;j<m;j++)
		{
			if(sum==input2[j])
			break;
			count++;
		}
	}
		if(count==m+n)
		{
			cout<<input1[i]<<" "<<input2[j];
		}
	   }
	}
}
int main()
{
	ll n,m;
	cin>>n;
	ll* input1=new ll[n];
	for(ll i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	ll* input2=new ll[m];
	for(ll i=0;i<m;i++)
	{
		cin>>input2[i];
	}
	choose(n,m,input1,input2);
}


#include<bits/stdc++.h>
using namespace std;
void choose(int n,int m,int input1[],int input2[])
{
	int count=0;
    for(int i=0;i<n;i++)
	{
	   for(int j=0;j<m;j++)
	   {
	   int sum=input1[i]+input2[j];
	   	for(int i=0,j=0;i<n,j<m;i++,j++)
	   	{
	   		 if(sum==input1[i] || sum==input2[j])
				break;
				count++;
		}
		if(count==max(n,m))
		{
			cout<<input1[i]<<" "<<input2[j];
		}
	   }
	}
}
int main()
{
	int n,m;
	cin>>n;
	int* input1=new int[n];
	for(int i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	int* input2=new int[m];
	for(int i=0;i<m;i++)
	{
		cin>>input2[i];
	}
	choose(n,m,input1,input2);
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
void choose(ll n,ll m,ll input1[],ll input2[])
{
	ll count=0;
    for(ll i=0;i<n;i++)
	{
	   for(ll j=m-1;j>=0;j--)
	   {
	   ll sum=input1[i]+input2[j];
	   	for(ll i=0;i<n;i++)
	   	{
	   		 if(sum==input1[i] )
				break;
				count++;
		}
		for(ll j=0;j<m;j++)
		{
			if(sum==input2[j])
			break;
			count++;
		}
		if(count==m+n)
		{
			cout<<input1[i]<<" "<<input2[j];
		}
	   }
	}
}
int main()
{
	ll n,m;
	cin>>n;
	ll* input1=new ll[n];
	for(ll i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	ll* input2=new ll[m];
	for(ll i=0;i<m;i++)
	{
		cin>>input2[i];
	}
	choose(n,m,input1,input2);
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
void choose(ll n,ll m,ll input1[],ll input2[])
{
	ll count=0;
    for(ll i=0;i<n;i++)
	{
	   for(ll j=m-1;j>=0;j--)
	   {
	   ll sum=input1[i]+input2[j];
	   	for(ll i=0,j=0;i<n || j<m;i++,j++)
	   	{
	   		 if(sum==input1[i] || sum==input2[j])
				break;
				count++;
		}
		if(count==max(n,m))
		{
			cout<<input1[i]<<" "<<input2[j];
		}
	   }
	}
}
int main()
{
	ll n,m;
	cin>>n;
	ll* input1=new ll[n];
	for(ll i=0;i<n;i++)
	{
		cin>>input1[i];
	}
	cin>>m;
	ll* input2=new ll[m];
	for(ll i=0;i<m;i++)
	{
		cin>>input2[i];
	}
	choose(n,m,input1,input2);
}


/// Coded by Dhiman Sarker Bappi (Dhimanda) - RMSTU
  /*
 	$%U%$
  */
#include<bits/stdc++.h>
using namespace std;
#define    F           first
#define    S           second
#define    pb          push_back
#define    popb        pop_back
#define    pf          push_front
#define    popf        pop_front
#define    lcm(a,b)    (a*b)/gcd(a,b)
#define    gcd(a,b)    __gcd(a,b)
#define    pi          2*acos(0)
#define    elif        else if
#define    ll          long long
#define    nl          '\n'
#define    endl        '\n'
#define    sp          fixed << setprecision
#define    all(x)      x.begin(),x.end()
#define    power(n,p)  pow_mod(n, p, (1LL<<62))
#define    yes         printf("YES\n")
#define    no          printf("NO\n")

// ===================== DEBUG  ==========================
#ifdef dhimanpc
template<typename T>void showSTL(T H);template<typename T,typename V>void showSTL(pair<T,V> H);
template<typename T>void showSTL(priority_queue<T> H);template<typename T>void showSTL(stack<T> H);
template<typename T,typename V>void showSTL(map<T,V> H);
template<typename T,typename V>void showSTL(multimap<T,V> H);template<typename T>void showSTL(vector<T> H);
template<typename T>void showSTL(set<T> H);template<typename T>void showSTL(multiset<T> H);
template<typename T>void showSTL(list<T> H);void showSTL(char *H);
template<typename T>void showSTL(deque<T> H);template<typename T>void showSTL(queue<T> H);
template<typename T>void showSTL(T H){stringstream ss;ss<<H;cerr<<ss.str();}
template<typename T,typename V>void showSTL(pair<T,V> H){cerr<<"(";showSTL(H.first);cerr<<"=>";showSTL(H.second);cerr<<")";}
template<typename T>void showSTL(priority_queue<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}cerr<<endl;}
template<typename T>void showSTL(stack<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}}
template<typename T,typename V>void showSTL(map<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T,typename V>void showSTL(multimap<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T>void showSTL(vector<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(set<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(multiset<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(list<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
void showSTL(char *H){for(int i=0;i<strlen(H);i++){showSTL(H[i]);};}
template<typename T>void showSTL(deque<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(queue<T> H){cerr<<"[ ";while(!H.empty()){showSTL(H.front());cerr<<' ';H.pop();}cerr<<"]";}
vector<string>vec_spltr(string s){s+=',';vector<string>res;while(!s.empty())
res.push_back(s.substr(0, s.find(','))),s=s.substr(s.find(',')+1);return res;}
void dbg_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM)
{cerr<<endl;}template<typename Head,typename... Tail>
void dbg_out ( vector <string> args, int idx, int LINE_NUM, Head H, Tail... T)
{if(idx>0)cerr<<", ";else cerr << "Line(" << LINE_NUM << "):";
cerr<<" "<<args[idx]<<" = ";showSTL(H);dbg_out(args,idx+1,LINE_NUM, T...);}
#define    debug(...) dbg_out(vec_spltr(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#define    in_file freopen("input.c", "r", stdin)
#define    out_file freopen("output.c", "w", stdout)
#define    fast        0
#else
#define    debug(...)  0
#define    in_file     0
#define    out_file    0
#define    fast        ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#endif
// ===================== custom function ==========================
ll pow_mod(ll nn, ll pp, ll mm) { ll res = 1; while(pp > 0) { if(pp&1) res = (res * nn) % mm; pp = pp >> 1; nn = (nn * nn) % mm; } return res; }

void dhimanda();
// ===================== Main function ==========================
int main()
{
    //fast;
    int t=1;
    //scanf("%i" , &t);
    for(int i=1 ; i<=t ; i++){
        //printf("Case %d: ", ṇi);
        dhimanda();
    }
    return 0;
}
void dhimanda(){
    int n;
    cin >> n;
    int ans1 = -1 ,ans2 = -1 ;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans1 = max(x,ans1) ;
    }
    cin >> n;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans2 = max(x,ans2) ;
    }
    cout << ans1 << " " << ans2 << endl;

}

// Contact : chessdhiman@gmail.com


/// Coded by Dhiman Sarker Bappi (Dhimanda) - RMSTU
  /*
 	$%U%$
  */
 // dhiman
#include<bits/stdc++.h>
using namespace std;
#define    F           first
#define    S           second
#define    pb          push_back
#define    popb        pop_back
#define    pf          push_front
#define    popf        pop_front
#define    lcm(a,b)    (a*b)/gcd(a,b)
#define    gcd(a,b)    __gcd(a,b)
#define    pi          2*acos(0)
#define    elif        else if
#define    ll          long long
#define    nl          '\n'
#define    endl        '\n'
#define    sp          fixed << setprecision
#define    all(x)      x.begin(),x.end()
#define    power(n,p)  pow_mod(n, p, (1LL<<62))
#define    yes         printf("YES\n")
#define    no          printf("NO\n")

// ===================== DEBUG  ==========================
#ifdef dhimanpc
template<typename T>void showSTL(T H);template<typename T,typename V>void showSTL(pair<T,V> H);
template<typename T>void showSTL(priority_queue<T> H);template<typename T>void showSTL(stack<T> H);
template<typename T,typename V>void showSTL(map<T,V> H);
template<typename T,typename V>void showSTL(multimap<T,V> H);template<typename T>void showSTL(vector<T> H);
template<typename T>void showSTL(set<T> H);template<typename T>void showSTL(multiset<T> H);
template<typename T>void showSTL(list<T> H);void showSTL(char *H);
template<typename T>void showSTL(deque<T> H);template<typename T>void showSTL(queue<T> H);
template<typename T>void showSTL(T H){stringstream ss;ss<<H;cerr<<ss.str();}
template<typename T,typename V>void showSTL(pair<T,V> H){cerr<<"(";showSTL(H.first);cerr<<"=>";showSTL(H.second);cerr<<")";}
template<typename T>void showSTL(priority_queue<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}cerr<<endl;}
template<typename T>void showSTL(stack<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}}
template<typename T,typename V>void showSTL(map<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T,typename V>void showSTL(multimap<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T>void showSTL(vector<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(set<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(multiset<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(list<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
void showSTL(char *H){for(int i=0;i<strlen(H);i++){showSTL(H[i]);};}
template<typename T>void showSTL(deque<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(queue<T> H){cerr<<"[ ";while(!H.empty()){showSTL(H.front());cerr<<' ';H.pop();}cerr<<"]";}
vector<string>vec_spltr(string s){s+=',';vector<string>res;while(!s.empty())
res.push_back(s.substr(0, s.find(','))),s=s.substr(s.find(',')+1);return res;}
void dbg_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM)
{cerr<<endl;}template<typename Head,typename... Tail>
void dbg_out ( vector <string> args, int idx, int LINE_NUM, Head H, Tail... T)
{if(idx>0)cerr<<", ";else cerr << "Line(" << LINE_NUM << "):";
cerr<<" "<<args[idx]<<" = ";showSTL(H);dbg_out(args,idx+1,LINE_NUM, T...);}
#define    debug(...) dbg_out(vec_spltr(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#define    in_file freopen("input.c", "r", stdin)
#define    out_file freopen("output.c", "w", stdout)
#define    fast        0
#else
#define    debug(...)  0
#define    in_file     0
#define    out_file    0
#define    fast        ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#endif
// ===================== custom function ==========================
ll pow_mod(ll nn, ll pp, ll mm) { ll res = 1; while(pp > 0) { if(pp&1) res = (res * nn) % mm; pp = pp >> 1; nn = (nn * nn) % mm; } return res; }

void dhimanda();
// ===================== Main function ==========================
int main()
{
    //fast;
    int t=1;
    //scanf("%i" , &t);
    for(int i=1 ; i<=t ; i++){
        //printf("Case %d: ", ṇi);
        dhimanda();
    }
    return 0;
}
void dhimanda(){
    int n;
    cin >> n;
    int ans1 = -1 ,ans2 = -1 ;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans1 = max(x,ans1) ;
    }
    cin >> n;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans2 = max(x,ans2) ;
    }
    cout << ans1 << " " << ans2 << endl;

}

// Contact : chessdhiman@gmail.com


// Problem: A. Choose Two Numbers
// Contest: Codeforces - Codeforces Round #580 (Div. 2)
// URL: https://codeforces.com/contest/1206/problem/A
/// Coded by Dhiman Sarker Bappi (Dhimanda) - RMSTU

#include<bits/stdc++.h>
using namespace std;
#define    F           first
#define    S           second
#define    pb          push_back
#define    popb        pop_back
#define    pf          push_front
#define    popf        pop_front
#define    lcm(a,b)    (a*b)/gcd(a,b)
#define    gcd(a,b)    __gcd(a,b)
#define    pi          2*acos(0)
#define    elif        else if
#define    ll          long long
#define    nl          '\n'
#define    endl        '\n'
#define    sp          fixed << setprecision
#define    all(x)      x.begin(),x.end()
#define    power(n,p)  pow_mod(n, p, (1LL<<62))
#define    yes         printf("YES\n")
#define    no          printf("NO\n")

// ===================== DEBUG  ==========================
#ifdef dhimanpc
template<typename T>void showSTL(T H);template<typename T,typename V>void showSTL(pair<T,V> H);
template<typename T>void showSTL(priority_queue<T> H);template<typename T>void showSTL(stack<T> H);
template<typename T,typename V>void showSTL(map<T,V> H);
template<typename T,typename V>void showSTL(multimap<T,V> H);template<typename T>void showSTL(vector<T> H);
template<typename T>void showSTL(set<T> H);template<typename T>void showSTL(multiset<T> H);
template<typename T>void showSTL(list<T> H);void showSTL(char *H);
template<typename T>void showSTL(deque<T> H);template<typename T>void showSTL(queue<T> H);
template<typename T>void showSTL(T H){stringstream ss;ss<<H;cerr<<ss.str();}
template<typename T,typename V>void showSTL(pair<T,V> H){cerr<<"(";showSTL(H.first);cerr<<"=>";showSTL(H.second);cerr<<")";}
template<typename T>void showSTL(priority_queue<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}cerr<<endl;}
template<typename T>void showSTL(stack<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}}
template<typename T,typename V>void showSTL(map<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T,typename V>void showSTL(multimap<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T>void showSTL(vector<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(set<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(multiset<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(list<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
void showSTL(char *H){for(int i=0;i<strlen(H);i++){showSTL(H[i]);};}
template<typename T>void showSTL(deque<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(queue<T> H){cerr<<"[ ";while(!H.empty()){showSTL(H.front());cerr<<' ';H.pop();}cerr<<"]";}
vector<string>vec_spltr(string s){s+=',';vector<string>res;while(!s.empty())
res.push_back(s.substr(0, s.find(','))),s=s.substr(s.find(',')+1);return res;}
void dbg_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM)
{cerr<<endl;}template<typename Head,typename... Tail>
void dbg_out ( vector <string> args, int idx, int LINE_NUM, Head H, Tail... T)
{if(idx>0)cerr<<", ";else cerr << "Line(" << LINE_NUM << "):";
cerr<<" "<<args[idx]<<" = ";showSTL(H);dbg_out(args,idx+1,LINE_NUM, T...);}
#define    debug(...) dbg_out(vec_spltr(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#define    in_file freopen("input.c", "r", stdin)
#define    out_file freopen("output.c", "w", stdout)
#define    fast        0
#else
#define    debug(...)  0
#define    in_file     0
#define    out_file    0
#define    fast        ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#endif
// ===================== custom function ==========================
ll pow_mod(ll nn, ll pp, ll mm) { ll res = 1; while(pp > 0) { if(pp&1) res = (res * nn) % mm; pp = pp >> 1; nn = (nn * nn) % mm; } return res; }

void dhimanda();
// ===================== Main function ==========================
int main()
{
    fast;
    int t=1;
    //scanf("%i" , &t);
    for(int i=1 ; i<=t ; i++){
        //printf("Case %d: ", ṇi);
        dhimanda();
    }
    return 0;
}
void dhimanda(){
    int n;
    cin >> n;
    int ans1 = -1 ,ans2 = -1 ;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans1 = max(x,ans1) ;
    }
    cin >> n;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans2 = max(x,ans2) ;
    }
    cout << ans1 << " " << ans2 << endl;

}

// Contact : chessdhiman@gmail.com


/// Coded by Dhiman Sarker Bappi (Dhimanda) - RMSTU

#include<bits/stdc++.h>
using namespace std;
#define    F           first
#define    S           second
#define    pb          push_back
#define    popb        pop_back
#define    pf          push_front
#define    popf        pop_front
#define    lcm(a,b)    (a*b)/gcd(a,b)
#define    gcd(a,b)    __gcd(a,b)
#define    pi          2*acos(0)
#define    elif        else if
#define    ll          long long
#define    nl          '\n'
#define    endl        '\n'
#define    sp          fixed << setprecision
#define    all(x)      x.begin(),x.end()
#define    power(n,p)  pow_mod(n, p, (1LL<<62))
#define    yes         printf("YES\n")
#define    no          printf("NO\n")

// ===================== DEBUG  ==========================
#ifdef dhimanpc
template<typename T>void showSTL(T H);template<typename T,typename V>void showSTL(pair<T,V> H);
template<typename T>void showSTL(priority_queue<T> H);template<typename T>void showSTL(stack<T> H);
template<typename T,typename V>void showSTL(map<T,V> H);
template<typename T,typename V>void showSTL(multimap<T,V> H);template<typename T>void showSTL(vector<T> H);
template<typename T>void showSTL(set<T> H);template<typename T>void showSTL(multiset<T> H);
template<typename T>void showSTL(list<T> H);void showSTL(char *H);
template<typename T>void showSTL(deque<T> H);template<typename T>void showSTL(queue<T> H);
template<typename T>void showSTL(T H){stringstream ss;ss<<H;cerr<<ss.str();}
template<typename T,typename V>void showSTL(pair<T,V> H){cerr<<"(";showSTL(H.first);cerr<<"=>";showSTL(H.second);cerr<<")";}
template<typename T>void showSTL(priority_queue<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}cerr<<endl;}
template<typename T>void showSTL(stack<T> H){cerr<<endl;while(!H.empty()){cerr<<H.top()<<endl;H.pop();}}
template<typename T,typename V>void showSTL(map<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T,typename V>void showSTL(multimap<T,V> H){cerr<<"[ ";for(auto val:H){showSTL(val);cerr<<" ";}cerr<<"]";}
template<typename T>void showSTL(vector<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(set<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(multiset<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(list<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
void showSTL(char *H){for(int i=0;i<strlen(H);i++){showSTL(H[i]);};}
template<typename T>void showSTL(deque<T> H){cerr<<"[ ";for(auto val : H){showSTL(val);cerr<<' ';}cerr<<"]";}
template<typename T>void showSTL(queue<T> H){cerr<<"[ ";while(!H.empty()){showSTL(H.front());cerr<<' ';H.pop();}cerr<<"]";}
vector<string>vec_spltr(string s){s+=',';vector<string>res;while(!s.empty())
res.push_back(s.substr(0, s.find(','))),s=s.substr(s.find(',')+1);return res;}
void dbg_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM)
{cerr<<endl;}template<typename Head,typename... Tail>
void dbg_out ( vector <string> args, int idx, int LINE_NUM, Head H, Tail... T)
{if(idx>0)cerr<<", ";else cerr << "Line(" << LINE_NUM << "):";
cerr<<" "<<args[idx]<<" = ";showSTL(H);dbg_out(args,idx+1,LINE_NUM, T...);}
#define    debug(...) dbg_out(vec_spltr(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#define    in_file freopen("input.c", "r", stdin)
#define    out_file freopen("output.c", "w", stdout)
#define    fast        0
#else
#define    debug(...)  0
#define    in_file     0
#define    out_file    0
#define    fast        ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#endif
// ===================== custom function ==========================
ll pow_mod(ll nn, ll pp, ll mm) { ll res = 1; while(pp > 0) { if(pp&1) res = (res * nn) % mm; pp = pp >> 1; nn = (nn * nn) % mm; } return res; }

void dhimanda();
// ===================== Main function ==========================
int main()
{
    //fast;
    int t=1;
    //scanf("%i" , &t);
    for(int i=1 ; i<=t ; i++){
        //printf("Case %d: ", ṇi);
        dhimanda();
    }
    return 0;
}
void dhimanda(){
    int n;
    cin >> n;
    int ans1 = -1 ,ans2 = -1 ;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans1 = max(x,ans1) ;
    }
    cin >> n;
    for(int i=0 ; i < n ; i++) {
    	int x; cin >> x;
    	ans2 = max(x,ans2) ;
    }
    cout << ans1 << " " << ans2 << endl;

}

// Contact : chessdhiman@gmail.com


#include <iostream>
using namespace std;
int main()
{
	int n, m, x, flag = 0;
	int a[100], b[100];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> b[i];
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			flag = 0;
			x = a[i] + b[j];
			for (int g = 0, z = 0; g < n, z < m; g++, z++)
			{
				if (x == a[g] && x == b[z])
				{
					flag = 1;
					break;
				}
			}
			if (flag == 0)
			{
				cout << a[i] << " " << b[i] << endl;
				break;
			}
		}
		if (flag == 0)
		{
			break;
		}
	}
}


#include <iostream>

using namespace std;
int main()
{
    int A[101], B[101];
    int n, m, a = 0, b = 0, sum = 0, flag = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> A[i];
    cin >> m;
    for (int i = 1; i <= m; i++)
        cin >> B[i];
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            flag = 0;
            sum = A[i] + B[j];
            for (int k = 1; k <= n; k++)
            {
                if (sum == A[k])
                {
                    flag = 1;
                    break;
                }
            }
            for (int k = 1; k <= m; k++)
            {
                if (sum == B[k])
                {
                    flag = 1;
                    break;
                }
            }
            if (flag == 0)
            {
                a = A[i];
                b = B[j];
                break;
            }
        }
        if (flag == 0) { break; }
    }
    cout << a << " " << b << endl;
}


#include <iostream>

using namespace std;
int main()
{
    int A[101], B[101];
    int n, m, a = 0, b = 0, sum = 0, flag = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> A[i];
    cin >> m;
    for (int i = 1; i <= m; i++)
        cin >> B[i];
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            flag = 0;
            sum = A[i] + B[j];
            for (int k = 1; k <= n; k++)
            {
                if (sum != A[k])
                {
                    a = A[i];
                    b = B[j];
                    flag = 1;
                }
            }
            if (flag == 0)
            {
                break;
            }
            for (int k = 1; k <= m; k++)
            {
                if (sum != B[k])
                {
                    a = A[i];
                    b = B[j];
                }
            }
        }
    }
    cout << a << " " << b << endl;
}


#include <iostream>
using namespace std;
int main()
{
	int n, m, x, flag = 0;
	int a[100], b[100];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	cin >> m;
	for (int i = 0; i < m; i++)
	{
		cin >> b[i];
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < m; j++)
		{
			flag = 0;
			x = a[i] + b[j];
			for (int g = 0; g < n; g++)
			{
				if (a[g] == x)
				{
					flag = 1;
					break;
				}
			}
			for (int g = 0; g < m; g++)
			{
				if (b[g] == x)
				{
					flag = 1;
					break;
				}
			}
			if (flag == 0)
			{
				cout << a[i] << " " << b[j] << endl;
				break;
			}
		}
		if (flag == 0)
		{
			break;
		}
	}
}


#include <iostream>

using namespace std;
int main()
{
    int A[101], B[101];
    int n, m, a = 0, b = 0, sum = 0, flag = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> A[i];
    cin >> m;
    for (int i = 1; i <= m; i++)
        cin >> B[i];
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            sum = A[i] + B[j];
            for (int k = 1; k <= n; k++)
            {
                flag = 0;
                if (sum != A[k])
                {
                    if (flag == 0)
                    {
                        a = A[i];
                        b = B[j];
                        flag = 1;
                    }
                }
            }
            if (flag == 1)
            {
                break;
            }
            for (int k = 1; k <= m; k++)
            {
                flag = 0;
                if (sum != B[k])
                {
                    if (flag == 0)
                    {
                        a = A[i];
                        b = B[j];
                    }
                }
            }
        }
    }
    cout << a << " " << b << endl;

    return 0;
}


#include <iostream>

using namespace std;
int main()
{
    int A[101], B[101];
    int n, m, a = 0, b = 0, sum = 0, flag = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> A[i];
    cin >> m;
    for (int i = 1; i <= m; i++)
        cin >> B[i];
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            sum = A[i] + B[j];
            for (int k = 1; k <= n; k++)
            {
                flag = 0;
                if (sum != A[k])
                {
                    a = A[i];
                    b = B[j];
                    flag = 1;
                }
            }
            if (flag == 0)
            {
                break;
            }
            for (int k = 1; k <= m; k++)
            {
                flag = 0;
                if (sum != B[k])
                {
                    a = A[i];
                    b = B[j];
                }
            }
        }
    }
    cout << a << " " << b << endl;
}


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

int A[100],hA[210],B[100], hB[210];
int main()
{
	int n;		cin>>n;
	for(int i = 0; i < n; ++i){
		cin>>A[i];hA[A[i]] = 1;
	}
	int m;		cin>>m;
	for(int i = 0; i < m; ++i){
		cin>>B[i];hB[B[i]] = 1;
	}
	int f = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			int S = A[i] + B[j];
			if(!A[S] && !B[S]){
				cout<<A[i]<<' '<<B[j];
				f = 1;
				break;
			}
		}
		if(f == 1)
			break;
	}

	return 0;
}


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

int A[110],hA[210],B[110], hB[210];
int main()
{
	int n;		cin>>n;
	for(int i = 0; i < n; ++i){
		cin>>A[i];hA[A[i]] = 1;
	}
	int m;		cin>>m;
	for(int i = 0; i < m; ++i){
		cin>>B[i];hB[B[i]] = 1;
	}
	int f = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			int S = A[i] + B[j];
			if(S <= 200)
			if(!A[S] && !B[S]){
				cout<<A[i]<<' '<<B[j];
				f = 1;
				break;
			}
			else if(S > 200){
				f = 1;	break;
			}
		}
		if(f == 1)
			break;
	}

	return 0;
}


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

int A[110],hA[210],B[110], hB[210];
int main()
{
	int n;		cin>>n;
	for(int i = 0; i < n; ++i){
		cin>>A[i];hA[A[i]] = 1;
	}
	int m;		cin>>m;
	for(int i = 0; i < m; ++i){
		cin>>B[i];hB[B[i]] = 1;
	}
	int f = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			int S = A[i] + B[j];
			if(S <= 200){
			if(!hA[S] && !hB[S]){
				cout<<A[i]<<' '<<B[j];
				f = 1;
				break;
			}
			}
			else if(S > 200){
				f = 1;	break;
			}
		}
		if(f == 1)
			break;
	}

	return 0;
}


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

int A[110],hA[210],B[110], hB[210];
int main()
{
	int n;		cin>>n;
	for(int i = 0; i < n; ++i){
		cin>>A[i];hA[A[i]] = 1;
	}
	int m;		cin>>m;
	for(int i = 0; i < m; ++i){
		cin>>B[i];hB[B[i]] = 1;
	}
	int f = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
			int S = A[i] + B[j];
			cout<<S<<' ';
			cout<<A[S]<<' '<<B[S]<<endl;
			if(S <= 200){
			if(!hA[S] && !hB[S]){
				cout<<A[i]<<' '<<B[j];
				f = 1;
				break;
			}
			}
			else if(S > 200){
				f = 1;	break;
			}
		}
		if(f == 1)
			break;
	}

	return 0;
}


/*
* @authr AVINISH KUMAR
* @college BIT MESRA
*/
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define maxn 1000000000000000
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define o2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
#define o3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
#define o1(a) cout<<#a<<" "<<a<<endl;
typedef long long ll;
typedef double db;
/*typedef unsigned long long ull;
typedef long double ld;
const ll inf=1e18;
const ll M=1e9+7;
string to_string(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_lleger(string s){stringstream ss(s); ll x; ss>>x; return x;}*/

int main()
{
//    freopen("input1.txt","r",stdin);
//    freopen("output2.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    map<ll,ll> m1;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        m1[a[i]]=1;
    }
    ll m;
    cin>>m;
    ll b[m];
    for(ll i=0;i<m;i++)
    {
        cin>>b[i];
        m1[b[i]]=1;
    }
    ll flag=1;
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
        {
            ll k=a[i]+b[j];

            if(m1[k]==0)
            {
                cout<<a[i]<<" "<<b[i]<<endl;
                flag=0;
                break;
            }
            if(flag==0)
            break;
        }
    }
}


/*
* @authr AVINISH KUMAR
* @college BIT MESRA
*/
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define maxn 1000000000000000
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define o2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
#define o3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
#define o1(a) cout<<#a<<" "<<a<<endl;
typedef long long ll;
typedef double db;
/*typedef unsigned long long ull;
typedef long double ld;
const ll inf=1e18;
const ll M=1e9+7;
string to_string(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_lleger(string s){stringstream ss(s); ll x; ss>>x; return x;}*/

int main()
{
//    freopen("input1.txt","r",stdin);
//    freopen("output2.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    map<ll,ll> m1;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        m1[a[i]]=1;
    }
    ll m;
    cin>>m;
    ll b[m];
    for(ll i=0;i<m;i++)
    {
        cin>>b[i];
        m1[b[i]]=1;
    }
    ll flag=1;
    for(ll i=0;i<n;i++)
    {
        for(ll j=0;j<m;j++)
        {
            ll k=a[i]+b[j];

            if(m1[k]==0)
            {
                cout<<a[i]<<" "<<b[i]<<endl;
                break;
            }
        }
    }
}


/*
* @authr AVINISH KUMAR
* @college BIT MESRA
*/
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define maxn 1000000000000000
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define o2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
#define o3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
#define o1(a) cout<<#a<<" "<<a<<endl;
typedef long long ll;
typedef double db;
/*typedef unsigned long long ull;
typedef long double ld;
const ll inf=1e18;
const ll M=1e9+7;
string to_string(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_lleger(string s){stringstream ss(s); ll x; ss>>x; return x;}*/

int main()
{
//    freopen("input1.txt","r",stdin);
//    freopen("output2.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
     //    m1[a[i]]=1;
    }
    ll m;
    cin>>m;
    ll b[m];
    for(ll i=0;i<m;i++)
    {
        cin>>b[i];
     //    m1[b[i]]=1;
    }
    sort(a,a+n);
    sort(b,b+m);
    ll k=a[n-1]+b[m-1];
    cout<<k;
}


/*
* @authr AVINISH KUMAR
* @college BIT MESRA
*/
#include<bits/stdc++.h>
using namespace std;
// #define mod 1000000007
// #define maxn 1000000000000000
// #define ff first
// #define ss second
// #define pb push_back
// #define o2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
// #define o3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
// #define o1(a) cout<<#a<<" "<<a<<endl;
typedef long long ll;
// typedef double db;
/*typedef unsigned long long ull;
typedef long double ld;
const ll inf=1e18;
const ll M=1e9+7;
string to_string(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_lleger(string s){stringstream ss(s); ll x; ss>>x; return x;}*/

int main()
{
    freopen("input1.txt","r",stdin);
    freopen("output2.txt","w",stdout);
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll m;
    cin>>m;
    ll b[m];
    for(ll i=0;i<m;i++)
    {

        cin>>b[i];
    }
    sort(a,a+n);
    sort(b,b+m);
    cout<<a[n-1]<<" "<<b[m-1];
}


/*
* @authr AVINISH KUMAR
* @college BIT MESRA
*/
#include<bits/stdc++.h>
using namespace std;
// #define mod 1000000007
// #define maxn 1000000000000000
// #define ff first
// #define ss second
// #define pb push_back
// #define o2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
// #define o3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
// #define o1(a) cout<<#a<<" "<<a<<endl;
typedef long long ll;
// typedef double db;
/*typedef unsigned long long ull;
typedef long double ld;
const ll inf=1e18;
const ll M=1e9+7;
string to_string(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_lleger(string s){stringstream ss(s); ll x; ss>>x; return x;}*/

int main()
{
//    freopen("input1.txt","r",stdin);
//    freopen("output2.txt","w",stdout);
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll m;
    cin>>m;
    ll b[m];
    for(ll i=0;i<m;i++)
    {

        cin>>b[i];
    }
    sort(a,a+n);
    sort(b,b+m);
    cout<<a[n-1]<<" "<<b[m-1];
}


/*
* @authr AVINISH KUMAR
* @college BIT MESRA
*/
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define maxn 1000000000000000
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define o2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
#define o3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
#define o1(a) cout<<#a<<" "<<a<<endl;
typedef long long ll;
typedef double db;
/*typedef unsigned long long ull;
typedef long double ld;
const ll inf=1e18;
const ll M=1e9+7;
string to_string(ll x){stringstream ss; ss<<x; return ss.str();}
ll to_lleger(string s){stringstream ss(s); ll x; ss>>x; return x;}*/

int main()
{
//    freopen("input1.txt","r",stdin);
//    freopen("output2.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        m1[a[i]]=1;
    }
    ll m;
    cin>>m;
    ll b[m];
    for(ll i=0;i<m;i++)
    {
        cin>>b[i];
        m1[b[i]]=1;
    }
    sort(a,a+n);
    sort(b,b+m);
    ll k=a[n-1]+b[m-1];
    cout<<k;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	int b[m];
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);
	cout << a[0] << " " << b[m-1] << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	long long int b[m];
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);
	{
	for (int i = 0; i < m; i++)
	{
	for (int j = 0; j < n; j++)
	{
		if (a[0]+b[m] != b[i]) {
		cout << a[0] << " "<< b[m-1]; return 0;}
		else cout << b[0] << " " << a[n-1];
	}
	}
}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	long long int b[m];
	bool yas = true;
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);

	for (int i = 0; i < m; i++) if (a[0]+b[m-1]==b[i]) {yas=false; break;}
	if (yas==true) cout << a[0] << " " << b[m-1];
	else cout << b[0] << " " << a[n-1];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	long long int b[m];
	bool yas = true;
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);
	{
	for (int i = 0; i < m; i++)
	{
	if (b[0]+a[i]==b[i]) {yas=false; break;}
	}
	if (yas) cout << b[0] << " " << a[n-1];
	else cout << a[0] << " " << b[m-1];
}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	long long int b[m];
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);
	cout << a[0] << " " << b[m-1] << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	long long int b[m];
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);
	{
	for (int i = 0; i < m; i++)
	{
		if (a[0]+b[m] != b[i]) cout << a[0] << " "<< b[m-1];
		else cout << b[0] << " " << a[n-1];
	}
}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main ()
{
	int n, m;
	cin >> n;
	long long int a[n];
	for (int i = 0; i < n; i++) cin >> a[i];
	cin >> m;
	long long int b[m];
	bool yas = true;
	for (int i = 0; i < m; i++) cin >> b[i];
	sort (a, a+n);
	sort (b, b+m);
	cout << a[n-1] << " " << b[m-1];
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int32_t main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<b[n-1]<" "<<a[m-1]<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<b[n-1]<<" "<<a[m-1]<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<b[n-1]+a[m-1]<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<b[m-1]+a[n-1]<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int32_t main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    if(m>1)
    sort(a,a+m);
    if(n>1)
    sort(b,b+n);
    cout<<b[n-1]+a[m-1]<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int32_t main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++)
        cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<a[m-1]<<" "<<b[n-1]<<endl;
    return 0;
}


#include<bits/stdc++h>
using namespace std;
int main(){
    int m,n;
    cin>>m;
    int a[m];
    for(int i=0;i<m;i++)
        cin>>a[i];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>b[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<b[m-1]+a[n-1]<<endl;
    return 0;
}


#include<bits/stdc++h>
using namespace std;
int main(){
    int m,n;
    cin>>m>>n;
    int a[m],b[n];
    for(int i=0;i<m;i++)
        cin>>a[i];
    for(int i=0;i<m;i++)
        cin>>a[i];
    sort(a,a+m);
    sort(b,b+n);
    cout<<b[m-1]+a[n-1]<<endl;
    return 0;
}


#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <set>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <deque>

using namespace std;

int main() {
    int n, m;
    int a[101], b[101];

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

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

    sort(a, a+n):
    sort(b, b+m);

    cout << a[n-1] + b[m-1] << "\n"

    return 0;
}


#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <set>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <deque>

using namespace std;

int main() {
    int n, m;
    int a[101], b[101];

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

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

    sort(a, a+n);
    sort(b, b+m);

    cout << a[n-1] + b[m-1] << "\n";

    return 0;
}


#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <set>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <deque>

using namespace std;

int main() {
    int n, m;
    int a[101], b[101];

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

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

    sort(a, a+n);
    sort(b, b+m);

    cout << a[n-1] << " " << b[m-1] << "\n";

    return 0;
}


#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <set>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <deque>

using namespace std;

int main() {
    int n, m;
    int a[101], b[101];

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

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

    sort(a, a+n);
    sort(b, b+m);

    cout << a[n-1] + b[m-1] << "\n"

    return 0;
}


#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <set>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <deque>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
typedef pair<ll, pll> plp;
typedef pair<pll, int> ppi;
typedef pair<pll, ll> ppl;
typedef pair<pll, pll> ppp;
typedef vector<int> vi;
typedef vector<ll> vll;

int main() {
    int n, m, maxn = -1, maxm = -1;

    cin >> n;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        maxn = max(maxn, a);
    }

    cin >> m;
    for (int i = 0; i < m; i++) {
        int a;
        cin >> a;
        maxm = max(maxm, a);
    }

    cout << maxn << " " << maxm << "\n";

    return 0;
}


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

int main()
{
    int n1,n2,i,j,xa,xb;
    cin>>n1;
    int a[n1+10];
    for (i=0; i<n1 ; i++)
    {
        cin>>a[i];
    }
    xa=a[i];
    sort(a,a+n1);
    cin>>n2;
    int b[n2+10];
    for (i=0; i<n2 ; i++)
    {
        cin>>b[i];
    }
    xb=b[j];
    sort(b,b+n2);
    for (i=0; i<n1 ; i++)
    {
        for (j=0; j<n2 ; j++)
        {
            if(a[i]+b[j]>xa && a[i]+b[j]>xb)
            {
                cout<<a[i]<<" "<<b[j]<<" ";
                break;
            }
        }
    }

}


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

int main()
{
    int n1,n2,i,j,xa,xb;
    cin>>n1;
    int a[n1+10];
    for (i=0; i<n1 ; i++)
    {
        cin>>a[i];
    }
    xa=a[i];
    sort(a,a+n1);
    cin>>n2;
    int b[n2+10];
    for (i=0; i<n2 ; i++)
    {
        cin>>b[i];
    }
    xb=b[j];
    sort(b,b+n2);
    for (i=0; i<n1 ; i++)
    {
        for (j=0; j<n2 ; j++)
        {
            if(a[i]+b[j]>xa && a[i]+b[j]>xb)
            {
                cout<<a[i]<<" "<<b[j]<<endl;
                break;
            }
        }
    }

}


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

int main()
{
    int n1,n2,i,j,xa=-2,xb=-2,as,bs;
    cin>>n1;
    int a[n1+10];
    for (i=0; i<n1 ; i++)
    {
        cin>>a[i];
        if(a[i]>xa)
        {
            xa=a[i];
        }
    }
    cin>>n2;
    int b[n2+10];
    for (i=0; i<n2 ; i++)
    {
        cin>>b[i];
        if(b[i]>xb)
        {
            xb=b[i];
        }
    }
    for (i=0; i<n1 ; i++)
    {
        for (j=0; j<n2 ; j++)
        {
            if(a[i]+b[j]>xa && a[i]+b[j]>xb)
            {
                as=a[i];
                bs=b[j];
                break;
            }
        }
    }
    cout<<as<<" "<<bs;

}


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

int main()
{
    int n1,n2,i,j,xa,xb;
    cin>>n1;
    int a[n1+10];
    for (i=0; i<n1 ; i++)
    {
        cin>>a[i];
    }
    xa=a[i];
    sort(a,a+n1);
    cin>>n2;
    int b[n2+10];
    for (i=0; i<n2 ; i++)
    {
        cin>>b[i];
    }
    xb=b[j];
    sort(b,b+n2);
    for (i=0; i<n1 ; i++)
    {
        for (j=0; j<n2 ; j++)
        {
            if(a[i]+b[j]>xa && a[i]+b[j]>xb)
            {
                cout<<a[i]<<" "<<b[j];
                break;
            }
        }
    }

}


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

int main()
{
    int n1,n2,i,j,xa,xb;
    cin>>n1;
    int a[n1+10];
    for (i=0; i<n1 ; i++)
    {
        cin>>a[i];
    }
    xa=a[i];
    sort(a,a+n1);
    cin>>n2;
    int b[n2+10];
    for (i=0; i<n2 ; i++)
    {
        cin>>b[i];
    }
    xb=b[j];
    sort(b,b+n2);
    for (i=0; i<n1 ; i++)
    {
        for (j=0; j<n2 ; j++)
        {
            if(a[i]+b[j]>xa && a[i]+b[j]>xb)
            {
                cout<<a[i]<<" "<<b[j]<<endl;
            }
        }
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i,j,k,count=0,flag=0;
    vector<int> vec1(m),vec2(n),vec3;
    cin>>m;
    for(i=0;i<m;i++)
    cin>>vec1[i];
    cin>>n;
    for(i=0;i<n;i++)
    cin>>vec2[i];

    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            if(vec1[i]==vec2[j]){

             vec3.push_back(vec1[i]);
             count++;
            }
        }
    }
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            flag=0;
            for(k=0;k<count;k++)
            {
                if((vec1[i]+vec2[j])!=vec3[k])
                flag++;
            }
            if(flag==count){
            cout<<vec1[i]<<" "<<vec2[j]<<endl;
            break;
            }
        }
        if(flag==count)
        break;
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i,j,k,count=0,flag=0;
    set<int> vec3;
    cin>>m;
    vector<int> vec1(m);
    for(i=0;i<m;i++)
    cin>>vec1[i];
    cin>>n;
    vector<int> vec2(n);
    for(i=0;i<n;i++)
    cin>>vec2[i];

    for(i=0;i<m;i++)
    {
             vec3.insert(vec1[i]);
             count++;
    }
    for(i=0;i<n;i++)
    {
             vec3.insert(vec2[i]);
             count++;
    }
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            flag=0;
            for(k=0;k<count;k++)
            {
                if(vec3.find(vec1[i]+vec2[j])==vec3.end())
                flag++;
            }
            if(flag==count){
            cout<<vec1[i]<<" "<<vec2[j]<<endl;
            break;
            }
        }
        if(flag==count)
        break;
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i,j,k,count=0,flag=0;
    vector<int> vec1(m),vec2(n),vec3;
    cin>>m;
    for(i=0;i<m;i++)
    cin>>vec1[i];
    cin>>n;
    for(i=0;i<n;i++)
    cin>>vec2[i];

    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            if(vec1[i]==vec2[j]){

             vec3.push_back(vec1[i]);
             count++;
            }
        }
    }
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
 flag=0;
            for(k=0;k<count;k++)
            {
                if((vec1[i]+vec2[j])!=vec3[k])
                flag++;
            }
            if(flag==count){
            cout<<vec1[i]<<" "<<vec2[j]<<endl;
            break;
            }
        }
        if(flag==count)
        break;
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i;
    vector<int> v1,v2;
    cin>>m;
    for(i=0;i<m;i++)
    cin>>v1[i];
    cin>>n;
    for(i=0;i<n;i++)
    cin>>v2[i];

    sort(v1.begin(),v1.end());
    sort(v2.begin(),v2.end());

    cout<<v1[m-1]<<" "<<v2[n-1];
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i;
    cin>>m;
    vector<int> v1(m);
    for(i=0;i<m;i++)
    cin>>v1[i];
    cin>>n;
    vector<int> v2(n);
    for(i=0;i<n;i++)
    cin>>v2[i];

    sort(v1.begin(),v1.end());
    sort(v2.begin(),v2.end());

    cout<<v1[m-1]<<" "<<v2[n-1];
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i,j,k,count=0,flag=0;
    vector<int> vec3;
    cin>>m;
    vector<int> vec1(m);
    for(i=0;i<m;i++)
    cin>>vec1[i];
    cin>>n;
    vector<int> vec2(n);
    for(i=0;i<n;i++)
    cin>>vec2[i];

    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            if(vec1[i]==vec2[j]){

             vec3.push_back(vec1[i]);
             count++;
            }
        }
    }
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            flag=0;
            for(k=0;k<count;k++)
            {
                if((vec1[i]+vec2[j])!=vec3[k])
                flag++;
            }
            if(flag==count){
            cout<<vec1[i]<<" "<<vec2[j]<<endl;
            break;
            }
        }
        if(flag==count)
        break;
    }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n,i;
    vector<int> v1,v2;
    cin>>m;
    for(i=0;i<m;i++)
    cin>>v1[i];

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

    sort(v1.begin(),v1.end());
    sort(v2.begin(),v2.end());

    cout<<v1[m-1]<<" "<<v2[n-1];
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n;
    vector<int> a;
    int i,x;
    for(i=0;i<n;i++)
    { cin>>x;
        a.push_back(x);
    }
    cin>>m;
    vector<int> b;
    for(i=0;i<m;i++)
    {
        cin>>x;
        b.push_back(x);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    cout<<a[n-1]<<" "<<b[m-1];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,i,j,x;
    cin>>n;
    vector<int> a;
    for(i=0;i<n;i++)
    {cin>>x;
    a.push_back(x);
    }
    cin>>m;
    vector<int> b;
    for(i=0;i<m;i++)
    {cin>>x;
    b.push_back(x);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end())
    for(i=0,j=0;i<min(n,m);i++,j++)
     if(a[i]+b[i]>a[n]&&a[i]+b[i]>b[n])
     { cout<<a[i]<<" "<<b[i];
       break;

     }

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long i,n,m,x,p,k,j;
   // int aflag
    cin>>n;
    vector<long long> a;
    for(i=0;i<n;i++)
    {cin>>x;
      a.push_back(x);
    }
    cin>>m;
    vector<long long> b;
    for(i=0;i<m;i++)
    { cin>>x;
      b.push_back(x);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    for(i=0,j=0;i<min(m,n);i++)
    { p=a[i] + b[j];
       auto it = find(a.begin(),a.end(),p);
       if(it!=a.end())
       continue;
       auto ti = find(b.begin(),b.end(),p);
        if(ti!=b.end())
        continue;
        cout<<a[i]<<" "<<b[i];
        if(i>6)
        j++;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long i,n,m,x,p,k,j;
   // int aflag
    cin>>n;
    vector<long long> a;
    for(i=0;i<n;i++)
    {cin>>x;
      a.push_back(x);
    }
    cin>>m;
    vector<long long> b;
    for(i=0;i<m;i++)
    { cin>>x;
      b.push_back(x);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    for(i=0,j=0;i<min(m,n);i++)
    { p=a[i] + b[i];
       auto it = find(a.begin(),a.end(),p);
       if(it!=a.end())
       continue;
       auto ti = find(b.begin(),b.end(),p);
        if(ti!=b.end())
        continue;
        cout<<a[i]<<" "<<b[i];
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m;
    cin>>n;
    vector<int> a;
    int i,x;
    for(i=0;i<n;i++)
    { cin>>x;
        a.push_back(x);
    }
    cin>>m;
    vector<int> b;
    for(i=0;i<m;i++)
    {
        cin>>x;
        b.push_back(x);
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end());
    cout<<a[n-1]<<" "<<b[n-1];
    return 0;
}


#include<bits/stdc++.h>
#define mp make_pair
#define lli long long int
#define ulli unsigned long long int
#define dout if(debug)cout<<" "
#define mod 1000000007
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	//cin >> t;
	while(t--){
   int n;
   cin >> n;
   vector<int> arra(n);
   for(int i = 0; i < n; i++){
     cin >> arra[i];
   }

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

   sort(arra.begin(), arra.end());
   sort(arrb.begin(), arrb.end());

   for(int i = 0; i < n; i++){
     int flag_temp = 0;
     for(int j = 0; j < o; j++){
       int sum = arra[i] + arrb[j];
       int flag = 0;
       for(int k = 0; k < n; k++){
         if(arra[k] == sum)
           flag = 1;
       }

       for(int k = 0; k < o; k++){
         if(arrb[k] == sum)
           flag = 1;
       }

       if(flag == 0){
         cout << arra[i] << " " << arrb[j] << endl;
         flag_temp = 1;
         break;
       }
     }

     if(flag_temp == 1)
       break;
   }

  }
	return 0;
}
//Hi there Sourav Sahoo please use lli instead of int


#include<bits/stdc++.h>
#define mp make_pair
#define lli long long int
#define ulli unsigned long long int
#define dout if(debug)cout<<" "
#define mod 1000000007
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	//cin >> t;
	while(t--){
   int n;
   cin >> n;
   vector<int> arra(n);
   for(int i = 0; i < n; i++){
     cin >> arra[i];
   }

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

   sort(arra.begin(), arra.end());
   sort(arrb.begin(), arrb.end());

   for(int i = 0; i < n; i++){
     int flag = 0;
     for(int j = 0; j < o; j++){
       int sum = arra[i] + arrb[j];
       if(lower_bound(arra.begin(), arra.end(), sum)-arra.begin() != sum && lower_bound(arrb.begin(), arrb.end(), sum)-arrb.begin() != sum){
         cout << arra[i] << " " << arrb[j] << endl;
         flag = 1;
         break;
       }

     }
       if(flag == 1)
         break;
   }
  }
	return 0;
}
//Hi there Sourav Sahoo please use lli instead of int


#include<bits/stdc++.h>
#define mp make_pair
#define lli long long int
#define ulli unsigned long long int
#define dout if(debug)cout<<" "
#define mod 1000000007
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	//cin >> t;
	while(t--){
    int n;
    cin >> n;
    lli sum = 0;
    for(int i = 1; i <= 2*n; i++){
      sum+= i;
    }

    int div = sum/2;
    if(div - (1+(2*n)) > 2*n){
      cout << "NO" << endl;
    }

    if ( n == 1){
      cout << "YES" << endl;
      cout << "1 2" << endl;
    }

    if(n == 2){
      cout << "YES" << endl;
      cout << "1 3 2 4" << endl;
    }

    if(n == 3){
      cout << "YES" << endl;
      cout << "1 4 5 2 3 6" << endl;
    }
	}
	return 0;
}
//Hi there Sourav Sahoo please use lli instead of int


#include<bits/stdc++.h>
#define mp make_pair
#define lli long long int
#define ulli unsigned long long int
#define dout if(debug)cout<<" "
#define mod 1000000007
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	//cin >> t;
	while(t--){
   int n;
   cin >> n;
   vector<int> arra(n);
   for(int i = 0; i < n; i++){
     cin >> arra[i];
   }

   int o;
   cin >> o;
   vector<int> arrb(o);
   for(int i = 0; i < o; i++){
     cin >> arrb[i];
   }

   sort(arra.begin(), arra.end());
   sort(arrb.begin(), arrb.end());

   cout << arra[n-1] << " " << arrb[o-1] << endl;

  }
	return 0;
}
//Hi there Sourav Sahoo please use lli instead of int


#include<bits/stdc++.h>
#define mp make_pair
#define lli long long int
#define ulli unsigned long long int
#define dout if(debug)cout<<" "
#define mod 1000000007
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t;
	t=1;
	//cin >> t;
	while(t--){
   int n;
   cin >> n;
   vector<int> arra(n);
   for(int i = 0; i < n; i++){
     cin >> arra[i];
   }

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

   sort(arra.begin(), arra.end());
   sort(arrb.begin(), arrb.end());

   cout << arra[n-1] << " " << arrb[o-1] << endl;

  }
	return 0;
}
//Hi there Sourav Sahoo please use lli instead of int


/***

            Bismillahir Rahmanir Rahim
            Read in the name of Allah, who created you!!!
            Author : Shah Newaj Rabbi Shishir,
            Department of CSE, City University, Bangladesh.

***/

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

#define             jeno_joyer_khuda_thake      int main (void)
#define             kaj_shesh                   return 0
#define             sf                          scanf
#define             pf                          printf
#define             ssf                         sscanf
#define             spf                         sprintf
#define             fsf                         fscanf
#define             fpf                         fprintf
#define             fast                        ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define             scase                       sf ("%d",&tc)
#define             whilecase                   while (tc--)
#define             sn                          sf ("%d",&n)
#define             eof                         while (cin >> n)
#define             pcase                       pf ("Case %d: ",pos)
#define             llu                         unsigned long long
#define             lld                         long long
#define             U                           unsigned int
#define             for0(i,n)                   for (i=0; i<n; i++)
#define             for1(i,n)                   for (i=1; i<=n; i++)
#define             forab(i,a,b)                for (i=a; i<=b; i++)
#define             rof0(i,n)                   for (i=n-1; i>=0; i--)
#define             rof1(i,n)                   for (i=n; i>=1; i--)
#define             rofab(i,a,b)                for (i=b; i>=a; i--)
#define             c(str)                      cin >> str
#define             g(str)                     	getline (cin,str)
#define             vi                          vector <int>
#define             vlld                        vector <lld>
#define             si                          set <int>
#define             slld                        set <lld>
#define             ss                          set <string>
#define             vs                          vector <string>
#define             pii                         pair <int,int>
#define             mii                         map <int,int>
#define             msi                         map <string,int>
#define             pb                          push_back
#define             in                          insert
#define             B                           begin()
#define             E                           end()
#define             rB                          rbegin()
#define             rE                          rend()
#define             F                           first
#define             S                           second
#define             iterate(it,x)               for (it=x.B; it!=x.E; it++)
#define             sortR(x,a,b)            	sort (x.B+a,x.B+b+1)
#define             rev(x)                  	reverse (x.B,x.E)
#define             revR(x,a,b)             	reverse (x.B+a,x.B+b+1)
#define             cl(x)                       x.clear()
#define             end1                        "\n"

const int MOD = 1000000007;
const int MAX = 1000001;
const double PI = acos(-1.0);

int SetBit (int n, int X) { return n | (1 << X); }
int ClearBit (int n, int X) { return n & ~(1 << X); }
int ToggleBit (int n, int X) { return n ^ (1 << X); }
bool CheckBit (int n, int X) { return (bool)(n & (1 << X)); }

int a[105],b[105];

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

    int n,m,i,j,k;

    sf ("%d",&n);

    for (i=0; i<n; i++)
        sf ("%d",&a[i]);

    sf ("%d",&m);

    for (i=0; i<m; i++)
        sf ("%d",&b[i]);

    sort (a,a+n);
    sort (b,b+m);

    for (i=0; i<n; i++)
    {
        for (j=0; j<m; j++)
        {
            k = a[i]+b[j];

            if (!binary_search(a,a+n,k) && !binary_search(b,b+m,k))
            {
                pf ("%d\n%d\n",a[i],b[j]);
                cout << k << endl;
                kaj_shesh;
            }
        }
    }

    kaj_shesh;
}


/***

            Bismillahir Rahmanir Rahim
            Read in the name of Allah, who created you!!!
            Author : Shah Newaj Rabbi Shishir,
            Department of CSE, City University, Bangladesh.

***/

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

#define             jeno_joyer_khuda_thake      int main (void)
#define             kaj_shesh                   return 0
#define             sf                          scanf
#define             pf                          printf
#define             ssf                         sscanf
#define             spf                         sprintf
#define             fsf                         fscanf
#define             fpf                         fprintf
#define             fast                        ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define             scase                       sf ("%d",&tc)
#define             whilecase                   while (tc--)
#define             sn                          sf ("%d",&n)
#define             eof                         while (cin >> n)
#define             pcase                       pf ("Case %d: ",pos)
#define             llu                         unsigned long long
#define             lld                         long long
#define             U                           unsigned int
#define             for0(i,n)                   for (i=0; i<n; i++)
#define             for1(i,n)                   for (i=1; i<=n; i++)
#define             forab(i,a,b)                for (i=a; i<=b; i++)
#define             rof0(i,n)                   for (i=n-1; i>=0; i--)
#define             rof1(i,n)                   for (i=n; i>=1; i--)
#define             rofab(i,a,b)                for (i=b; i>=a; i--)
#define             c(str)                      cin >> str
#define             g(str)                     	getline (cin,str)
#define             vi                          vector <int>
#define             vlld                        vector <lld>
#define             si                          set <int>
#define             slld                        set <lld>
#define             ss                          set <string>
#define             vs                          vector <string>
#define             pii                         pair <int,int>
#define             mii                         map <int,int>
#define             msi                         map <string,int>
#define             pb                          push_back
#define             in                          insert
#define             B                           begin()
#define             E                           end()
#define             rB                          rbegin()
#define             rE                          rend()
#define             F                           first
#define             S                           second
#define             iterate(it,x)               for (it=x.B; it!=x.E; it++)
#define             sortR(x,a,b)            	sort (x.B+a,x.B+b+1)
#define             rev(x)                  	reverse (x.B,x.E)
#define             revR(x,a,b)             	reverse (x.B+a,x.B+b+1)
#define             cl(x)                       x.clear()
#define             end1                        "\n"

const int MOD = 1000000007;
const int MAX = 1000001;
const double PI = acos(-1.0);

int SetBit (int n, int X) { return n | (1 << X); }
int ClearBit (int n, int X) { return n & ~(1 << X); }
int ToggleBit (int n, int X) { return n ^ (1 << X); }
bool CheckBit (int n, int X) { return (bool)(n & (1 << X)); }

int a[105],b[105];

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

    int n,m,i,j,k;

    sf ("%d",&n);

    for (i=0; i<n; i++)
        sf ("%d",&a[i]);

    sf ("%d",&m);

    for (i=0; i<m; i++)
        sf ("%d",&b[i]);

    sort (a,a+n);
    sort (b,b+m);

    for (i=0; i<n; i++)
    {
        for (j=0; j<m; j++)
        {
            k = a[i]+b[j];

            if (!binary_search(a,a+n,k) && !binary_search(b,b+m,k))
            {
                pf ("%d\n%d\n",a[i],b[j]);
                kaj_shesh;
            }
        }
    }

    kaj_shesh;
}


/***

            Bismillahir Rahmanir Rahim
            Read in the name of Allah, who created you!!!
            Author : Shah Newaj Rabbi Shishir,
            Department of CSE, City University, Bangladesh.

***/

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

#define             jeno_joyer_khuda_thake      int main (void)
#define             kaj_shesh                   return 0
#define             sf                          scanf
#define             pf                          printf
#define             ssf                         sscanf
#define             spf                         sprintf
#define             fsf                         fscanf
#define             fpf                         fprintf
#define             fast                        ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define             scase                       sf ("%d",&tc)
#define             whilecase                   while (tc--)
#define             sn                          sf ("%d",&n)
#define             eof                         while (cin >> n)
#define             pcase                       pf ("Case %d: ",pos)
#define             llu                         unsigned long long
#define             lld                         long long
#define             U                           unsigned int
#define             for0(i,n)                   for (i=0; i<n; i++)
#define             for1(i,n)                   for (i=1; i<=n; i++)
#define             forab(i,a,b)                for (i=a; i<=b; i++)
#define             rof0(i,n)                   for (i=n-1; i>=0; i--)
#define             rof1(i,n)                   for (i=n; i>=1; i--)
#define             rofab(i,a,b)                for (i=b; i>=a; i--)
#define             c(str)                      cin >> str
#define             g(str)                     	getline (cin,str)
#define             vi                          vector <int>
#define             vlld                        vector <lld>
#define             si                          set <int>
#define             slld                        set <lld>
#define             ss                          set <string>
#define             vs                          vector <string>
#define             pii                         pair <int,int>
#define             mii                         map <int,int>
#define             msi                         map <string,int>
#define             pb                          push_back
#define             in                          insert
#define             B                           begin()
#define             E                           end()
#define             rB                          rbegin()
#define             rE                          rend()
#define             F                           first
#define             S                           second
#define             iterate(it,x)               for (it=x.B; it!=x.E; it++)
#define             sortR(x,a,b)            	sort (x.B+a,x.B+b+1)
#define             rev(x)                  	reverse (x.B,x.E)
#define             revR(x,a,b)             	reverse (x.B+a,x.B+b+1)
#define             cl(x)                       x.clear()
#define             end1                        "\n"

const int MOD = 1000000007;
const int MAX = 1000001;
const double PI = acos(-1.0);

int SetBit (int n, int X) { return n | (1 << X); }
int ClearBit (int n, int X) { return n & ~(1 << X); }
int ToggleBit (int n, int X) { return n ^ (1 << X); }
bool CheckBit (int n, int X) { return (bool)(n & (1 << X)); }

int a[105],b[105];

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

    int n,m,i,j,k;

    sf ("%d",&n);

    for (i=0; i<n; i++)
        sf ("%d",&a[i]);

    sf ("%d",&m);

    for (i=0; i<m; i++)
        sf ("%d",&b[i]);

    sort (a,a+n);
    sort (b,b+m);

    pf ("%d\n",a[n-1]+b[m-1]);

    kaj_shesh;
}


/***

            Bismillahir Rahmanir Rahim
            Read in the name of Allah, who created you!!!
            Author : Shah Newaj Rabbi Shishir,
            Department of CSE, City University, Bangladesh.

***/

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

#define             jeno_joyer_khuda_thake      int main (void)
#define             kaj_shesh                   return 0
#define             sf                          scanf
#define             pf                          printf
#define             ssf                         sscanf
#define             spf                         sprintf
#define             fsf                         fscanf
#define             fpf                         fprintf
#define             fast                        ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define             scase                       sf ("%d",&tc)
#define             whilecase                   while (tc--)
#define             sn                          sf ("%d",&n)
#define             eof                         while (cin >> n)
#define             pcase                       pf ("Case %d: ",pos)
#define             llu                         unsigned long long
#define             lld                         long long
#define             U                           unsigned int
#define             for0(i,n)                   for (i=0; i<n; i++)
#define             for1(i,n)                   for (i=1; i<=n; i++)
#define             forab(i,a,b)                for (i=a; i<=b; i++)
#define             rof0(i,n)                   for (i=n-1; i>=0; i--)
#define             rof1(i,n)                   for (i=n; i>=1; i--)
#define             rofab(i,a,b)                for (i=b; i>=a; i--)
#define             c(str)                      cin >> str
#define             g(str)                     	getline (cin,str)
#define             vi                          vector <int>
#define             vlld                        vector <lld>
#define             si                          set <int>
#define             slld                        set <lld>
#define             ss                          set <string>
#define             vs                          vector <string>
#define             pii                         pair <int,int>
#define             mii                         map <int,int>
#define             msi                         map <string,int>
#define             pb                          push_back
#define             in                          insert
#define             B                           begin()
#define             E                           end()
#define             rB                          rbegin()
#define             rE                          rend()
#define             F                           first
#define             S                           second
#define             iterate(it,x)               for (it=x.B; it!=x.E; it++)
#define             sortR(x,a,b)            	sort (x.B+a,x.B+b+1)
#define             rev(x)                  	reverse (x.B,x.E)
#define             revR(x,a,b)             	reverse (x.B+a,x.B+b+1)
#define             cl(x)                       x.clear()
#define             end1                        "\n"

const int MOD = 1000000007;
const int MAX = 1000001;
const double PI = acos(-1.0);

int SetBit (int n, int X) { return n | (1 << X); }
int ClearBit (int n, int X) { return n & ~(1 << X); }
int ToggleBit (int n, int X) { return n ^ (1 << X); }
bool CheckBit (int n, int X) { return (bool)(n & (1 << X)); }

int a[105],b[105];

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

    int n,m,i,j,k;

    sf ("%d",&n);

    for (i=0; i<n; i++)
        sf ("%d",&a[i]);

    sf ("%d",&m);

    for (i=0; i<m; i++)
        sf ("%d",&b[i]);

    sort (a,a+n);
    sort (b,b+n);

    for (i=0; i<n; i++)
    {
        for (j=0; j<m; j++)
        {
            k = a[i]+b[j];

            if (!binary_search(a,a+n,k) && !binary_search(b,b+m,k))
            {
                pf ("%d\n%d\n",a[i],b[j]);
                kaj_shesh;
            }
        }
    }

    kaj_shesh;
}


#include<bits/stdc++.h>
using namespace std;
int a[150001],b[150001],n;
bool isprime(int x)
{
	for(int i=2;i*i<=x;i++) if(x%i==0) return 0;
	return 1;
}
inline void check(int x)
{
	if(!isprime(x)) return;
	for(int i=2;i<=n;i++) if(a[i]%x!=0&&b[i]%x!=0) return;
	cout<<x;exit(0);
}
inline void Try(int x)
{
	bool flag=1;
	for(int i=2;i*i<=x;i++) if(x%i==0) check(i),check(x/i),flag=0;
	if(flag) check(x);
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d%d",a+i,b+i);
	Try(a[1]);Try(b[1]);
	puts("-1");return 0;
}


#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;

char* get_new_c_string(const char* a, const char* b){
    char* c_s = (char*)malloc((strlen(a) + strlen(b)) * sizeof(char) + 1);
    strcpy(c_s, a);
    strcat(c_s, b);
    return c_s;
}

const int MAX_NR_OF_DIFF_PRIMES = 15;

int my_prime[MAX_NR_OF_DIFF_PRIMES];
int my_freq[MAX_NR_OF_DIFF_PRIMES];

int main(int argc, char** argv){
    #ifndef ONLINE_JUDGE
        freopen(get_new_c_string(argv[1], ".in"), "r", stdin);
        freopen(get_new_c_string(argv[1], ".out"), "w", stdout);
    #endif

    for(int j = 0; j < MAX_NR_OF_DIFF_PRIMES; ++j){
        my_freq[j] = 0;
    }

    int n, x, y, nr_prime = 0;
    scanf("%d\n", &n);
    scanf("%d %d\n", &x, &y);

    for(long long i = 2; i * i <= max(x, y); ++i){
        if((x % i == 0) || (y % i == 0)){
            my_prime[nr_prime] = i;
            my_freq[nr_prime] = 1;
            ++nr_prime;

            while(x % i == 0) x /= i;
            while(y % i == 0) y /= i;
        }
    }

    if(x > 1){
        my_prime[nr_prime] = x;
        ++my_freq[nr_prime];
        ++nr_prime;
    }

    if(y > 1){
        my_prime[nr_prime] = y;
        ++my_freq[nr_prime];
        ++nr_prime;
    }

    for(int i = 2; i <= n; ++i){
        scanf("%d %d\n", &x, &y);
        for(int j = 0; j < nr_prime; ++j){
            int p = my_prime[j];
            if((x % p == 0) || (y % p == 0)){
                ++my_freq[j];
            }
        }
    }

    int sol = -1;
    for(int j = 0; j < nr_prime; ++j){
        if(my_freq[j] >= n){
            sol = my_prime[j];
            break;
        }
    }

    printf("%d", sol);
    return 0;
}