#include <bits/stdc++.h>

#define maxn 100005
#define mod 1000000007
#define inf 0x3f3f3f3f
#define start ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
using namespace std;
int a[55], b[55];
int n;

bool judge(int x) {
    int zuo, you, shang, xia;
    zuo = xia = inf;
    you = shang = -inf;
    for (int i = 0; i < 4 * n + 1; ++i) {
        if (i != x) {
            zuo = min(zuo, a[i]);
            you = max(you, a[i]);
            shang = max(shang, b[i]);
            xia = min(xia, b[i]);
        }
    }
    for (int i = 0; i < 4 * n + 1; ++i)
        if (i != x)
            if (a[i] != zuo && a[i] != you && b[i] != shang && b[i] != xia)
                return false;
    return shang - xia == you - zuo;
}

int main() {
    start;
    cin >> n;
    for (int i = 0; i < 4 * n + 1; ++i)
        cin >> a[i] >> b[i];
    for (int i = 0; i < 4 * n + 1; ++i) {
        if (judge(i)) {
            cout << a[i] << ' ' << b[i] << endl;
            return 0;
        }
    }
    return 0;
}

#include <iostream>
#include <fstream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <list>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
#define MP make_pair
#define PB push_back
const ll N=100005;
int n, m;
vector <int> g[N];
int a[N], b[N], c[N];
set < pair<int,int> > q;
int x[50], y[50];
void solve()
{
	int n;
	scanf("%d", &n);
	for (int i = 0; i < 4 * n + 1; ++i) {
		scanf("%d%d", &x[i], &y[i]);
	}
	for (int i = 0; i < 4 * n + 1; ++i) {
		int mnx = 1e9, mny = 1e9, mxx = -1e9, mxy = -1e9;
		for (int j = 0; j < 4 * n + 1; ++j) {
			if (i == j) {
				continue;
			}
			mnx = min(mnx, x[j]);
			mny = min(mny, y[j]);
			mxx = max(mxx, x[j]);
			mxy = max(mxy, y[j]);
		}
		if (mxx - mnx != mxy - mny) {
			continue;
		}
		int cnt = 0;
		for (int j = 0; j < 4 * n + 1; ++j) {
			if (i == j) {
				continue;
			}
			if (x[j] == mnx || x[j] == mxx || y[j] == mny || y[j] == mxy) {
				cnt++;
			}
		}
		if (cnt == 4 * n) {
			printf("%d %d\n", x[i], y[i]);
			return;
		}
	}
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}

#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1234567890
#define pii pair<int,int>
#define LL long long
using namespace std;

int main () {
    //clock_t start = clock();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    vector<pii> a;
    for (int i=1;i<=4*n+1;i++) {
        int x,y;
        cin >> x >> y;
        a.pb(mp(x,y));
    }

    for (int i=0;i<=50;i++) {
        for (int j=0;j<=50;j++) {
            for (int p=1;p<=50;p++) {
                vector<pii> ans;
                for (int k=0;k<(int)a.size();k++) {
                    if ((a[k].fi>i&&a[k].fi<i+p&&a[k].se>j&&a[k].se<j+p)||(a[k].fi<i)||a[k].fi>i+p||a[k].se<j||a[k].se>j+p) ans.pb(a[k]);
                }
                if (ans.size()==1) {
                    //cout << i << j << p << endl;
                    cout << ans[0].fi << " " << ans[0].se << endl;
                    return 0;
                }
            }
        }
    }
    //cerr << fixed << setprecision(3) << (clock()-start)*1./CLOCKS_PER_SEC << endl;
    return 0;
}

#include<iostream>
#include<string.h>
#include<algorithm>
#include<cstdio>
using namespace std;
struct Node{
	int x,y;
}node[100];
int n,book[51][51],heng[51],shu[51];
int minx=0x3f3f3f3f,miny=0x3f3f3f3f,maxx,maxy;
int x1,x2,y1,y2;
inline int judgein(int i){
	if(node[i].x>x1&&node[i].x<x2&&node[i].y>y1&&node[i].y<y2) return 1;
	return 0;
}
inline int judgeout(int i){
	if(node[i].x<x1||node[i].x>x2||node[i].y<y1||node[i].y>y2) return 1;
	return 0;
}
int main(){
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
	    cin>>node[i].x>>node[i].y;
		heng[node[i].x]++;shu[node[i].y]++;
		minx=min(minx,node[i].x);maxx=max(maxx,node[i].x);
		miny=min(miny,node[i].y);maxy=max(maxy,node[i].y);
		book[node[i].x][node[i].y]=1;
	}
	for(int i=0;;i++)
	if(heng[i]>=n){
		x1=i;break;
	}
	for(int i=50;i>=0;i--)
	if(heng[i]>=n){
		x2=i;break;
	}
	for(int i=0;;i++)
	if(shu[i]>=n){
		y1=i;break;
	}
	for(int i=50;i>=0;i--)
	if(shu[i]>=2){
		y2=i;break;
	}
//	printf("minx=%d miny=%d maxx=%d maxy=%d\n",minx,miny,maxx,maxy);
//	printf("x1=%d y1=%d x2=%d y2=%d\n",x1,y1,x2,y2);
	int S1=(maxx-minx)*(maxy-miny),S2=(x2-x1)*(y2-y1);
	if(S1==S2){
		for(int i=1;i<=4*n+1;i++)
		if(judgein(i)) return printf("%d %d\n",node[i].x,node[i].y),0;
	}
	else{
		for(int i=1;i<=4*n+1;i++){
			if(judgeout(i)) return printf("%d %d\n",node[i].x,node[i].y),0;
		}
	}
	return 0;
}

#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define sz 1009
ll n,m,i,j,k,l,t,a,b,c,d,e,f,arr[sz],brr[sz],x,y,z;
vector<pair<ll,ll> >v;
int main()
{
    scanf("%lld",&n);
    for(i=0;i<=4*n;i++)
        scanf("%lld %lld",&arr[i],&brr[i]);
    for(i=0;i<=4*n;i++)
    {
        for(j=0;j<=4*n;j++)
        {
            if(i==j)
                continue;
            v.push_back({arr[j],brr[j]});
        }
        sort(v.begin(),v.end());
        k=0;
        a=v[0].first;
        j=1;
        while(j<4*n && v[j].first==a)
            j++;
        e=j;
        j--;
        a=v[0].second;
        b=v[j].second;
        c=v.back().first;
        j=4*n-2;
        while(j>=0 && v[j].first==c)
            j--;
        f=j;
        j++;
        c=v.back().second;
        d=v[j].second;
        ll g=-1;
        ll h=-1;
        for(j=e;j<=f;j++)
        {
            if(g==-1)
                g=v[j].second;
            else if(g!=v[j].second && h==-1)
                h=v[j].second;
            else if(g!=v[j].second && h!=v[j].second)
                k=1;
        }
        if(a<d)
            swap(a,d);
        if(b<c)
        swap(b,c);
        if(g>h)
            swap(g,h);
        if(k==0 && g>=0 && h>=0 && (g>a || h<b))
        k=1;
        if(k==0)
        {
            x=v.back().first-v[0].first;
            y=h-g;
            if(x!=y)
                k=1;
        }
        if(k==0)
        {
            printf("%lld %lld\n",arr[i],brr[i]);
            return 0;
        }
        v.clear();
    }
}

#pragma GCC optimize ("O3")
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <stack>
#include <unordered_map>
#define lld long long int
#define dbg1(vari1) cerr<<#vari1<<" = "<<(vari1)<<endl;
#define dbg2(vari1,vari2) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<endl;
#define dbg3(vari1,vari2,vari3) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<" "<<#vari3<<" = "<<(vari3)<<endl;
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	vector <pair <int,int> > v;
	int xmax=-1e9,ymax=-1e9,xmin=1e9,ymin=1e9;
    int arr[51]={0},arr2[51]={0};
	for(int i=0;i<4*n+1;i++)
	{
		int a,b;
		cin >> a >> b;
		v.push_back({a,b});
		arr[a]+=1;
		arr2[b]+=1;
	}
	for(int i=0;i<51;i++)
	{
		if(arr[i]>=n)
		{
			xmin=min(i,xmin);
			xmax=max(i,xmax);
		}
		if(arr2[i]>=n)
		{
		    ymin=min(i,ymin);
		    ymax=max(i,ymax);
		}
	}
	// dbg2(xmin,ymin);
	// dbg2(xmax,ymax);
	for(int i=0;i<4*n+1;i++)
	{
		if(v[i].first==xmin||v[i].first==xmax)
		{
			if((v[i].second)<ymin||v[i].second>ymax)
			{
				cout << v[i].first << " " << v[i].second ;
				break;
			}
		}
		else if(v[i].second==ymin||v[i].second==ymax)
		{
			if(v[i].first<xmin||v[i].first>xmax)
			{
				cout << v[i].first << " " << v[i].second ;
				break;
			}
		}
		else
		{
		    cout <<v[i].first <<" "<<v[i].second;
		}
	}
}

#include <bits/stdc++.h>

using namespace std;

const int M = 50;
int n, x[M], y[M];
pair <int, int> t[M];

int main () {
    scanf ("%d", &n);
    n = 4*n + 1;
    for (int i = 0; i < n; i++) scanf("%d %d", &x[i], &y[i]);
    for (int j = 0; j < n; j++) {
        int mx = 0, mix = 1e9, my = 0, miy = 1e9;
        for (int i = 0; i < n; i++) {
            if (i == j) continue;
            mx = max (mx, x[i]);
            mix = min (mix, x[i]);
            my = max (my, y[i]);
            miy = min (miy, y[i]);
        }
        bool ok = 1;
        if (mx-mix != my-miy) continue;

        for (int i = 0; i < n; i++) {
            if (i == j) continue;
            if (miy <= y[i] && y[i] <= my && (x[i] == mx || x[i] == mix)) continue;
            if (mix <= x[i] && x[i] <= mx && (y[i] == my || y[i] == miy)) continue;
            ok = 0;
        }
        if (ok) {cout << x[j] << ' ' << y[j] << endl; return 0;}
    }
}

#pragma GCC optimize ("O3")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define endl '\n'

const int N = 1000;

int n;
int x[N], y[N];

bool inside(int x1, int x2, int y1, int y2, int X, int Y)
{
    return (x1 < X && X < x2 && y1 < Y && Y < y2);
}

bool outside(int x1, int x2, int y1, int y2, int X, int Y)
{
    return (X < x1 || X > x2) || (Y < y1 || Y > y2);
}

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

    cin >> n;
    n = 4*n + 1;

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

    for(int x1 = 0; x1 <= 50; x1++)
    {
        for(int x2 = x1; x2 <= 50; x2++)
        {
            for(int y1 = 0; y1 <= 50; y1++)
            {
                for(int y2 = y1; y2 <= 50; y2++)
                {
                    int cnt = 0, xx = -1, yy = -1;

                    for(int i = 0; i < n; i++)
                    {
                        if (inside(x1, x2, y1, y2, x[i], y[i]) || outside(x1, x2, y1, y2, x[i], y[i]))
                            cnt++, xx = x[i], yy = y[i];
                    }
                    if (cnt == 1)
                        return cout << xx << " " << yy, 0;
                }
            }
        }
    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

struct dot {
    int x, y;

}A[100];
bool cmp (dot a, dot b) {
    return a.x < b.x;
}
bool cmp1 (dot a, dot b) {
    return a.y < b.y;
}

int main () {
    int n;
    cin >> n;
    for (int i = 0; i < 4 * n + 1; i++) {
        cin >> A[i].x >> A[i].y;
    }
    n = 4 * n + 1;
    sort(A, A + n, cmp);
    int dx = A[n - 1].x - A[0].x;
    int x1 = A[1].x, x2 = A[n - 2].x, x0 = A[0].x, x3 = A[n - 1].x;
    int y10 = A[0].y, y13 = A[n - 1].y;
    sort(A, A + n, cmp1);
    int dy = A[n - 1].y - A[0].y;
    int y0 = A[0].y, y1 = A[1].y, y2 = A[n - 2].y, y3 = A[n - 1].y;
    int x20 = A[0].x, x23 = A[n - 1].x;
    if (dx == dy) {
        for (int i = 0; i < n; i++) {
            if (A[i].x != x0 && A[i].x != x3 &&  A[i].y != y0 && A[i].y != y3) {
                cout << A[i].x << " " << A[i].y << endl;
                //system("pause");
                return 0;
            }
        }
    }
    else {
        if (dx > dy) {
            if (x2 - x0 <= dy) {
                cout << x3 << " " << y13 << endl;
            }
            else
                cout << x0 << " " << y10 << endl;
        }
        else {
            if (y3 - y1 <= dx)
                cout << x20 << " " << y0 << endl;
            else
                cout << x23 << " " << y3 << endl;
        }

    }

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

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 2005;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n;
	pair <int, int> p[42];
	cin >> n;
	n *= 4; n ++;
	for (int i=1; i<=n; i++) {
        cin >> p[i].first >> p[i].second;
	}
	sort (p+1, p+1+n);
	for (int i=1; i<=n; i++) {
        int x1 = 51, x2 = -1, y1 = 51, y2 = -1, m[5] = {0}, kk, k = 0;
        for (int j=1; j<=n; j++) {
            if (i == j) continue;
            x1 = min(x1, p[j].first);
            x2 = max(x2, p[j].first);
            y1 = min(y1, p[j].second);
            y2 = max(y2, p[j].second);
        }
        for (int j=1; j<=n; j++) {
            if (i == j) continue;
            kk = 0;
            if (p[j].first == x1) {
                if (p[j].second >= y1 && p[j].second <= y2) m[1] ++, kk ++;
            }
            if (p[j].first == x2) {
                if (p[j].second >= y1 && p[j].second <= y2) m[2] ++, kk ++;
            }
            if (p[j].second == y1) {
                if (p[j].first >= x1 && p[j].first <= x2) m[3] ++, kk ++;
            }
            if (p[j].second == y2) {
                if (p[j].first >= x1 && p[j].first <= x2) m[4] ++, kk ++;
            }
            if (!kk) k ++;
        }
        if (m[1] >= n/4 && m[2] >= n/4 && m[3] >= n/4 && m[4] >= n/4 && !k) {
            cout << p[i].first << " " << p[i].second;
            return 0;
        }
	}
    return 0;
}

/*
If you want to shine like a sun, first burn like a sun.
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int
#define ff first
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf LONG_MAX
#define minf LONG_MIN
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse
#define itr iterator
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/

int main()
{
    fast

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

	int n;
	cin>>n;

	vector<vpi> x(55),y(55);

	int a,b;
	forn(i,0,4*n+1)
	{
		cin>>a>>b;

		x[a].pb({a,b});
		y[b].pb({a,b});
	}

	forn(i,n,55)
	{
	    forn(j,0,55)
	    {
	    	if(x[j].sze >= n && (((j+i) < 55) && x[j+i].sze >= n))
	    	{
	    		forn(k,0,55)
	    		{
	    			if(y[k].sze >= n && (((k+i) < 55) && y[k+i].sze >= n))
	    			{
	    				forn(p,0,55)
	    				{
	    					if((p == j) || (p == (j+i)))
	    					{

	    						forn(q,0,x[p].sze)
	    						{
	    							if((x[p][q].ss < k) || (x[p][q].ss > (k+i)))
	    							{
		    							a = x[p][q].ff;
		    							b = x[p][q].ss;
		    							cout<<a<<" "<<b;
		    							return 0;
	    							}
	    						}

								continue;
	    					}
	    					else
	    					{
	    						forn(q,0,x[p].sze)
	    						{
	    							if((x[p][q].ss == k) || (x[p][q].ss == (k+i))) continue;

	    							a = x[p][q].ff;
	    							b = x[p][q].ss;
	    							cout<<a<<" "<<b;
	    							return 0;
	    						}
	    					}

	    				}
	    			}
	    		}
	    	}
	    }

	}

    return 0;
}

#include<bits/stdc++.h>
#define ll          long long
#define dl          double
#define pb          push_back
#define eb          emplace_back
#define mp          make_pair
#define F           first
#define S           second
#define endl        "\n"
#define rep(i,a,b)  for(i=a;i<b;i++)
#define all(v)      v.begin(),v.end()
#define allr(v)     v.rbegin(),v.rend()
#define mod         998244353
#define CIN(V,s,n)  for(int i=s;i<n;i++){cin >> V[i];}
#define COUT(V,s,n) for(int i=s;i<n;i++){cout <<  V[i] << " ";}
#define fast        ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define CLEAR(V);   for(ll i=0;i<V.size();i++) V[i] = 0;
using namespace std;

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

ll SUMD(ll n)
{   ll sum=0;
    while(n>0){sum += n%10;n = n/10;}
    return sum;
}

ll BS(vector<ll> &PS,ll s,ll e,ll ser)
{
    if(s>e)
        return s;
    ll mid = (s+e)/2;
    if(PS[mid]==ser)
    {
        return mid;
    }
    else if(PS[mid] > ser)
    {
        return BS(PS,s,mid-1,ser);
    }
    else
        return BS(PS,mid+1,e,ser);
}
ll MI(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;
    if (m == 1)
      return 0;
    while (a > 1)
    {
        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;
    return x;
}
/*
void Sieve(int n)
{
    memset(P,true,sizeof(P));
    P[0] = false;
    P[1]= false;
    for(ll i=2;i*i<=n;i++)
    {
        if(P[i])
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                P[j]=false;
            }
        }
    }

}
*/
int nCrModp(int n, int r, int p)
{
    int C[r+1];
    memset(C, 0, sizeof(C));

    C[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        for (int j = min(i, r); j > 0; j--)

            C[j] = (C[j] + C[j-1])%p;
    }
    return C[r];
}

int main()
{
ll t=1;
//cin >> t;
while(t--)
{
    string st="abcdefghijklmnopqrstuvwxyz";
    ll n,m,p,k,i,j,l,t1,r,u,v,x,y,a,b,c,d,q,flag=1,x1,x2,y1,y2;
    cin >> n;
    vector<pair<ll,ll> >  X,Y;
    for(i=0;i<4*n+1;i++)
    {
         cin >> x >> y;
         X.pb({x,y});
         Y.pb({y,x});
    }
    sort(allr(X));
    sort(allr(Y));
    for(i=0;i<4*n;i++)
    {
        if(X[i+1].F==X[i].F)
        {
            x2 = X[i].F;
            break;
        }
    }
    for(i=0;i<4*n;i++)
    {
        if(Y[i+1].F==Y[i].F)
        {
            y2 = Y[i].F;
            break;
        }
    }
    for(i=4*n;i>0;i--)
    {
        if(X[i-1].F==X[i].F)
        {
            x1 = X[i].F;
            break;
        }
    }
    for(i=4*n;i>0;i--)
    {
        if(Y[i-1].F==Y[i].F)
        {
            y1 = Y[i].F;
            break;
        }
    }

    //cout << x1 << y1 << x2 << y2 << endl;
    for(i=0;i<4*n+1;i++)
    {
        if((X[i].F==x1 || X[i].F == x2) and (X[i].S > y2 || X[i].S < y1 ))
        {
            cout << X[i].F << " " << X[i].S <<endl;
            return 0;
        }
        else if((X[i].S == y1 || X[i].S == y2) and (X[i].F > x2 || X[i].F < x1))
        {
            cout << X[i].F << " " << X[i].S <<endl;
            return 0;
        }
        else if( (X[i].F != x1 and X[i].F !=x2))
        {
            if((X[i].S !=y1 and X[i].S != y2))
            {
                cout << X[i].F << " " << X[i].S <<endl;
                return 0;
            }
        }
        else if(X[i].S !=y1 and X[i].S != y1)
        {
            if( (X[i].F != x1 and X[i].F !=x2))
            {
                cout << X[i].F << " " << X[i].S <<endl;
                return 0;
            }
        }
    }

}
    return 0;
}

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
#include <assert.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define SZ 666666
int n; pii p[SZ];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n*4+1;++i)
	{
		scanf("%d%d",&p[i].fi,&p[i].se);
	}
	for(int i=1;i<=n*4+1;++i)
	{
	int x1=2e9,x2=-2e9,y1=2e9,y2=-2e9;
	for(int j=1;j<=n*4+1;++j) if(i!=j)
	{
		x1=min(x1,p[j].fi);
		x2=max(x2,p[j].fi);
		y1=min(y1,p[j].se);
		y2=max(y2,p[j].se);
	}
	bool ok=1;
	int c1=0,c2=0,c3=0,c4=0;
	for(int j=1;j<=n*4+1;++j) if(i!=j)
	{
		if((p[j].fi==x1||p[j].fi==x2)
		||((p[j].se==y1||p[j].se==y2)))
		{
			if(p[j].fi==x1) ++c1;
			if(p[j].fi==x2) ++c2;
			if(p[j].se==y1) ++c3;
			if(p[j].se==y2) ++c4;
		}
		else ok=0;
	}
	if(ok&&c1>=n&&c2>=n&&c3>=n&&c4>=n&&x2-x1==y2-y1)
	{
		cout<<p[i].fi<<" "<<p[i].se<<"\n";
		return 0;
	}
	}
}

#include<bits/stdc++.h>
using namespace std;
#define ll          long long
#define pb          push_back
#define endl        '\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)  for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define fastio iostream::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
ll power(ll x, ll y, ll p){ ll res = 1;x = x % p;while (y > 0){ if (y & 1) res = (res*x) % p;y = y>>1;x = (x*x) % p;} return res; }

struct compare {
    bool operator()(const std::string& first, const std::string& second) {
        return first.size() > second.size();
    }
};

ll fun(ll x, ll y)
{
	return x*x+2*x*y+x+1;
}

ll a[40][2],n;

ll fun(ll p)
{
	ll x1=500,y1=500,x2=-1,y2=-1;
	for (int i = 0; i < 4*n+1; ++i)
	{
		if(i==p)continue;
		x1=min(x1,a[i][0]);
		x2=max(x2,a[i][0]);
		y1=min(y1,a[i][1]);
		y2=max(y2,a[i][1]);
	}

	if(x2-x1!=y2-y1)return 0;
	for (int i = 0; i < 4*n+1; ++i)
	{
		if(p==i)continue;
		if((a[i][0]>=x1 && a[i][0]<=x2) && (a[i][1]==y1 || a[i][1]==y2))continue;
		if((a[i][1]>=y1 && a[i][1]<=y2) && (a[i][0]==x1 || a[i][0]==x2))continue;
		return 0;
	}
	return 1;

}

int main()
{

    fastio;

    cin>>n;

    for (int i = 0; i < 4*n+1; ++i)
    {
    	cin>>a[i][0]>>a[i][1];
    }
    for (int i = 0; i < 4*n+1; ++i)
    {
    	if(fun(i))
    	{
    		cout<<a[i][0]<<" "<<a[i][1];
    		break;
    	}
    }

    return 0;
}

#include<bits/stdc++.h>
#include<iostream>
#include <iomanip>
using namespace std;
#define pii pair<int,int>
#define ll long long
#define pb push_back
#define fi first
#define se second
//#define mpr make_pair
#define gap ' '
#define abs(x) ((x)>0?(x):-(x))
#define INF 1e18
#define mod 998244353
ll powr(ll m,ll n)
{
    if(m==1)
        return 1;
    if(n==0)
        return 1;
    if(n==1)
        return m%mod;
    if(n%2)
    {
        ll te=powr(m,n/2);
        return (((te*te)%mod)*(m%mod))%mod;
    }
    else
    {
        ll te=powr(m,n/2);
        return (te*te)%mod;
    }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int tc=1;
   // cin>>tc;
       while(tc--)
    {
        int n;
        cin>>n;
        vector<pii> v;
        int ans=0;
        for(int i=0;i<(4*n)+1;i++)
        {
            int x,y;
            cin>>x>>y;
            v.pb({x,y});
        }
        for(int i=0;i<(4*n)+1;i++)
        {
            int mxx=-1,mxy=-1,mnx=100,mny=100;
            for(int j=0;j<(4*n)+1;j++)
            {
                if(j==i) continue;
                 mxx=max(mxx,v[j].fi);
                mnx=min(mnx,v[j].fi);
                mxy=max(mxy,v[j].se);
                mny=min(mny,v[j].se);

            if(mxx-mnx!=mxy-mny) continue;
            int ok=1;
            for(int j=0;j<(4*n)+1;j++)
            {
                if(j==i) continue;
                if(v[j].fi==mxx || v[j].fi==mnx)
                {
                    if(v[j].se>=mny && v[j].se<=mxy) ;
                    else ok=0;
                }
                else if(v[j].fi>mnx && v[j].fi<mxx)
                {
                    if(v[j].se==mxy || v[j].se==mny) ;
                    else ok=0;
                }
                else ok=0;
                if(!ok) break;
           }
            if(ok)
            {
                ans=i;
                break;
            }
        }
        }
        cout<<v[ans].fi<<gap<<v[ans].se;
    }

}

//                                      KiSmAt
#include "bits/stdc++.h"
using namespace std;

using ll = long long;

const ll inf = 1e18;
const int N = 2 * 1e5 + 10;

ll res;
ll a[N];

vector<pair<ll, ll> > v, vv;

bool foo(ll x, ll y, ll xx, ll yy){
    for(auto i: vv){
        if(i.first == x && y <= i.second && i.second <= yy)   continue;
        if(i.first == xx && y <= i.second && i.second <= yy)   continue;
        if(x <= i.first && i.first <= xx && i.second == y)   continue;
        if(x <= i.first && i.first <= xx && i.second == yy)   continue;
        return 0;
    }
    return 1;
}

void solve(){
    ll n, x, y, mx = inf, mi = inf;
    cin >> n;
    n = 4 * n + 1;
    for(int i = 0; i < n; ++i){
        cin >> x >> y;
        v.push_back({x, y});
    }
    for(int i = 0; i < v.size(); ++i){
        ll mx = inf, my = inf, mxx = -inf, myy = -inf;
        vv.clear();
        for(int j = 0; j < v.size(); ++j){
            if(i != j)  vv.push_back(v[j]);
        }
        for(auto j: vv){
            mx = min(mx, j.first);
            mxx = max(mxx, j.first);
            my = min(my, j.second);
            myy = max(myy, j.second);
        }
        if(abs(mx - mxx) == abs(my - myy) && foo(mx, my, mxx, myy)){
            cout << v[i].first << " " << v[i].second << "\n";
            return ;
        }
    }
}

int main(int argc, char const *argv[]){
    ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}
// nEro

#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;
const int N=1000006, INF=1000000009;
pair <int, int> p[N], a[N];
int n, m, k=1, t, x, y, z, o, ans[N], Ans, d, b[N], c[N], xmax, xmin=INF, ymax, ymin=INF;
string s, S;
vector <int> v[30];
int main(){
	cin>>n;
	for (int i=1; i<=4*n+1; i++){
		cin>>a[i].F>>a[i].S;
		b[a[i].F]++; c[a[i].S]++;
		xmax=max(a[i].F, xmax);
		xmin=min(a[i].F, xmin);
		ymax=max(a[i].S, ymax);
		ymin=min(a[i].S, ymin);
	}
	for (int i=1; i<=4*n+1; i++)
		if((b[a[i].F]==1 && (a[i].F==xmin || a[i].F==xmax)) ||
		   (c[a[i].S]==1 && (a[i].S==ymin || a[i].S==ymax))){cout<<a[i].F<<" "<<a[i].S; return 0;}
	for (int i=1; i<=4*n+1; i++)
		if(a[i].F!=xmin && a[i].F!=xmax && a[i].S!=ymin && a[i].S!=ymax){cout<<a[i].F<<" "<<a[i].S; return 0;}

	return 0;
}/*
2
0 0
0 2
0 3
1 0
1 3
2 0
3 1
3 3
2 2*/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define F(i,a,b) for(int i=int(a);i<=int(b);i++)
#define endl "\n"
#define ios std::ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define out(x) cout<<x<<endl,exit(0);
#define pb push_back
#define all(v) v.begin(),v.end()
#define I first
#define S second

int xcnt[55],ycnt[55],inf=1e9;
int main(){
	ios;
	int n;
	cin>>n;

	int x[4*n+4],y[4*n+4];
	F(i,1,4*n+1){
		cin>>x[i]>>y[i];
		xcnt[x[i]]++;
		ycnt[y[i]]++;
	}

	int xmx=0,ymx=0,xmn=0,ymn=0,x1,x2,y1,y2;
	F(i,0,50){
		if(xcnt[i]>xmn){
			xmn=xcnt[i];
			x1=i;
		}

		if(ycnt[i]>ymn){
			ymn=ycnt[i];
			y1=i;
		}

	}

	F(i,0,50){
		if(i!=x1 && xcnt[i]>=xmx){
			xmx=xcnt[i];
			x2=i;
		}
		if(i!=y1 && ycnt[i]>=ymx){
			ymx=ycnt[i];
			y2=i;
		}
	}

	if(x1>x2) swap(x1,x2);
	if(y1>y2) swap(y1,y2);
//	cout<<x1<<" "<<x2<<" "<<y1<<" "<<y2<<endl;

	F(i,1,4*n+1){
		if((x[i]!=x1 && x[i]!=x2) && (y[i]!=y1 && y[i]!=y2)){
			cout<<x[i]<<" "<<y[i];
			exit(0);
		}
		else if(y[i]>y2 || y[i]<y1){
			cout<<x[i]<<" "<<y[i];
			exit(0);
		}

		else if(x[i]>x2 || x[i]<x1){
			cout<<x[i]<<" "<<y[i];
			exit(0);
		}
	}
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <ctime>
#include <map>

#define inf 0x3f3f3f3f
#define Inf 0x3FFFFFFFFFFFFFFFLL
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, n) for (int i = 1; i <= (n); ++i)
#define clr(x, a) memset(x, (a), sizeof x)
using namespace std;
typedef long long ll;
int const N = 55;
int x[N], y[N];

int main() {
  int n; scanf("%d", &n);
  n = 4 * n + 1;
  rep(i, n) {
    scanf("%d%d", &x[i], &y[i]);
  }
  rep(i, n) {
    int lx = inf, rx = -1, ly = inf, ry = -1;
    rep(j, n) if (j != i) {
      lx = min(lx, x[j]);
      rx = max(rx, x[j]);
      ly = min(ly, y[j]);
      ry = max(ry, y[j]);
    }
    if (rx - lx != ry - ly) continue;
    bool ok = 1;
    rep(j, n) if (j != i) {
      if (x[j] != lx && x[j] != rx && y[j] != ly && y[j] != ry) {
        ok = 0; break;
      }
    }
    if (ok) {
      printf("%d %d\n", x[i], y[i]);
      break;
    }
  }
  return 0;
}

//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
#define mem(a,v) memset((a), (v), sizeof (a))
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%I64d", &(n))
#define nai(a, n) for (int i = 0; i < (n); i++) ni(a[i])
#define nal(a, n) for (int i = 0; i < (n); i++) nl(a[i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%I64d\n", (n))
#define pii pair<int, int>
#define pil pair<int, long long>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vil vector<pil>
#define vll vector<pll>
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e2 + 5;
const double eps = 1e-9;
int X[MAXN], Y[MAXN];

int main() {
	int n; ni(n);
	for (int i = 0; i <= 4*n; i++)
		scanf("%d %d", X+i, Y+i);
	for (int i = 0; i <= 50; i++) {
		for (int j = 0; j <= 50; j++) {
			for (int k = 0; k < j; k++) {
				int cnt = 0, ind = -1;
				for (int l = 0; l <= 4*n; l++)
					if (((k == X[l] || j == X[l]) && (i-(j-k) <= Y[l] && Y[l] <= i)) || ((i == Y[l] || i-(j-k) == Y[l]) && (k <= X[l] && X[l] <= j)))
						cnt++;
					else
						ind = l;
				if (cnt == 4*n)
					return !printf("%d %d\n", X[ind], Y[ind]);
			}
		}
	}
	printf("%d %d\n", X[0], Y[0]);
    return 0;
}

		#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd(a,b)
#define ff first
#define ss second
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define mp make_pair
#define pii acos(-1.0)
#define PI 3.1415926535897932385
#define Sin(a) sin((pi*a)/180)
#define siz 3000001
#define mem(ar) memset(ar,0,sizeof ar)
#define one(x) __builtin_popcount(x)
#define mod 100000009
#define faster ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
typedef long long ll;
#define rep(i,a,b) int i ; for( i=a;i<b;i++);
using namespace std;
int main(){

	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    int n,ele=-1;
    cin >> n;
    n = 4*n+1;
    vector<pi>v;
    map<pair<bool,int>,int> count;
    for(int i=0;i<n;i++){

    	int x,y;
    	cin >> x >> y;
    	v.pb({x,y});
    	count[{1,x}]++;
    	count[{0,y}]++;
    	ele = max(ele,max(x,y));
    }
  //  sort(all(count),greater<int());
    int minx=INT_MAX,miny=INT_MAX,maxx=INT_MIN,maxy=INT_MIN;
    for(auto i : count){

    	if(i.ss>=2){

    		pair<bool,int>p = i.ff;
    		if(p.ff == 1){

    			minx = min(minx,p.ss);
    			maxx = max(maxx,p.ss);
    		}
    		else{

    			miny = min(miny,p.ss);
    			maxy = max(maxy,p.ss);
    		}
    	}
    }
   // cout << maxx << ' ' << minx << ' ' << miny << endl;
    for(int i=0;i<n;i++){

    	if(v[i].ff == minx || v[i].ff == maxx){

    		if(v[i].ss < miny || v[i].ss > maxy){

    			cout << v[i].ff << ' ' << v[i].ss << endl;
    			break;
    		}
    	}
    	else if(v[i].ss == miny || v[i].ss == maxy){
    		if(v[i].ff < minx || v[i].ff> maxx){

    			cout << v[i].ff << ' ' << v[i].ss << endl;
    			break;
    		}
    	}
    	else{

    		cout << v[i].ff << ' ' << v[i].ss << endl;
    		break;
    	}
    }
    return 0;

}

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)

using namespace std;
using ll = long long;

int main()
{
    int  i = 0, n, min_x = INT_MAX, max_x = INT_MIN, min_y = INT_MAX, max_y = INT_MIN, x, y;
    cin >> n;
    int aa = n;
    n = 4 * n + 1;
    int temp = n;
    int xx[51] = { 0 }, yy[51] = { 0 };
    vector<pair<int, int>> p(4 * n + 100);
    while (n--)
    {
        cin >> x >> y;
        p[i].first = x;
        p[i].second = y;
        xx[x]++;
        yy[y]++;
        i++;
    }
    for (int i = 0; i <= 50; i++)
    {
        if (xx[i] >= aa)
        {
            if (i > max_x)
                max_x = i;
            if (i < min_x)
                min_x = i;
        }
        if (yy[i] >= aa)
        {
            if (i > max_y)
                max_y = i;
            if (i < min_y)
                min_y = i;
        }
    }
    //cout << min_x << " " << max_x << " " << min_y << " " << max_y;
    for (i = 0; i < temp; i++)
    {
        if ((p[i].first == min_x && p[i].second >= min_y && p[i].second <= max_y)
            || (p[i].first == max_x && p[i].second >= min_y && p[i].second <= max_y)
            || (p[i].second == min_y && p[i].first >= min_x && p[i].first <= max_x)
            || (p[i].second == max_y && p[i].first >= min_x && p[i].first <= max_x))
        {
            // do nothing
        }
        else
        {
            cout << p[i].first << " " << p[i].second;
            break;
        }
    }
    return 0;
}

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

#define ll long long

const int N = 100;
int x[N], y[N];
int xl = 100, xr = -1, yl = 100, yr = -1;

bool check(int x, int y) {
    return x >= xl && x <= xr && y >= yl && y <= yr &&
                (x == xl || x == xr || y == yl || y == yr);
}

signed main() {
#ifdef HOME
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;

    n = 4 * n + 1;

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

    for (int i = 0; i < n; i++) {
        xl = 100, xr = -1, yl = 100, yr = -1;
        for (int j = 0; j < n; j++) {
            if (i != j) {
                xl = min(xl, x[j]);
                xr = max(xr, x[j]);
                yl = min(yl, y[j]);
                yr = max(yr, y[j]);
            }
        }
        if (xr - xl != yr - yl)
            continue;
        bool ok = true;
        for (int j = 0; j < n; j++) {
            if (i != j) {
                if (!check(x[j], y[j])) {
                    ok = false;
                    break;
                }
            }
        }
        if (ok && !check(x[i], y[i])) {
            cout << x[i] << " " << y[i];
            return 0;
        }
    }

    return 0;
}

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

const int MAXN = 1e5 + 100;

#define ll long long
#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define X first
#define Y second

ll n, xs, ys, xe, ye, x, y, d[4];
ll cnt;
pll p[100];

int main(){
	fast_io;
	cin >> n;
	n = 4 * n + 1;
	for(ll i = 0; i < n; i++){
		cin >> p[i].X >> p[i].Y;
	}
	for(ll j = 0; j < n; j++){
		xe = -1;
		xs = 100;
		ye = -1;
		ys = 100;
		for(ll k = 0; k < n; k++){
			if(k != j){
				xs = min(xs, p[k].X);
				xe = max(xe, p[k].X);
				ys = min(ys, p[k].Y);
				ye = max(ye, p[k].Y);
			}
		}
		fill(d, d + 4, 0);
		//cout << xs << "_" << ys << " " << ys << "_" << ye << endl;
		cnt = 0;
		for(ll i = 0; i < n; i++){
			if(i == j){
				continue;
			}
			x = p[i].X;
			y = p[i].Y;

			if(x == xs){
				d[0]++;
			}
			if(x == xe){
				d[1]++;
			}
			if(y == ys){
				d[2]++;
			}
			if(y == ye){
				d[3]++;
			}
			if(x == xs || x == xe){
				if(y < ys || y > ye){
					cnt++;
				}
			}
			else if(y == ys || y == ye){
				if(x < xs || x > xe){
					cnt++;
				}
			}
			else{
				cnt++;
			}
		}
		//cout << d[0] << " " << d[1] << " " << d[2] << " " << d[3] << endl;
		if(cnt == 0 && d[0] >= n / 4 && d[1] >= n / 4 && d[2] >= n / 4 && d[3] >= n / 4){
			cout << p[j].X << ' ' << p[j].Y;
			return 0;
		}
	}
	return 0;
}

// Problem : C1. Heidi and the Turing Test (Easy)
// Contest : Codeforces - Helvetic Coding Contest 2019 online mirror (teams allowed, unrated)
// URL : https://codeforces.com/problemset/problem/1184/C1
// Memory Limit : 256 MB
// Time Limit : 3000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#define XOX
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;

#define int long long
#define re return
#define beg() begin()
#define cont continue
#define ldb long double
#define db double

#define br break
#define fr first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mkp make_pair

#define pi pair<int,int>
#define pll pair<ll,ll>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vll vector<ll>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >
#define vpll vector< pll >

#define mi map<int,int>
#define mdb map<db,db>
#define mldb map<ldb,ldb>

#define si set<int>
#define sdb set<db>
#define sldb set<ldb>

#define test int t; cin>>t; while(t--)
#define scan() int n; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]
#define scan2() int n,k; cin>>n>>k; int a[n]; for(int i=0;i<n;i++) cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++) cout<<a[i]<<' '
#define mem(a,v) memset(a,v,sizeof(a))
#define srt(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define cn(x) cout<<x<<"\n"
#define cs(x) cout<<x<<" "
#define c(x) cout<<x
#define all(v) v.begin(),v.end()

#define forr(i,a,b) for (int i = (a); i < (b); ++i)
#define rrof(i,a,b) for (int i = (b)-1; i >= (a); --i)

const int MOD = 1e9+7;
const ldb PI = 4*atan((ldb)1);
const int INF = 1e18;
const int NINF = -1e18;

int get_hash(string s){
	int N=1000001;
	int base[N],A=11,MD=1110111110111;
	base[0]=1;

	forr(i,1,N)
	base[i]=(base[i-1]*A)%MD;

	int hs=0;
	forr(i,0,s.size()){
		hs+=(s[i]*base[i]);
		hs%=MD;
	}

	re hs;
}

int power(int a,int n){
	int res=1;

	while(n){
		if(n%2)
		res*=a;
		a*=a;
		n/=2;
	}

	return res;
}

vector<string> vec_splitter(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 debug_out(
	vector<string> __attribute__ ((unused)) args,
	__attribute__ ((unused)) int idx,
	__attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
	template <typename Head, typename... Tail>
	void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

int32_t main(){
	fast;

	int n;
	cin>>n;

	vpi v,v1;
	forr(i,0,4*n+1){
		int x,y;
		cin>>x>>y;

		v.pb({x,y});
		v1.pb({y,x});
	}

	sort(all(v));
	sort(all(v1));

	int x1,x2,y1,y2;
	forr(i,0,v.size()){
		if(v[0].fr==v[1].fr)
		x1=v[0].fr;

		else
		x1=v[1].fr;

		if(v[v.size()-1].fr==v[v.size()-2].fr)
		x2=v[v.size()-1].fr;

		else
		x2=v[v.size()-2].fr;
	}

	forr(i,0,v1.size()){
		if(v1[0].fr==v1[1].fr)
		y1=v1[0].fr;

		else
		y1=v1[1].fr;

		if(v1[v1.size()-1].fr==v1[v1.size()-2].fr)
		y2=v1[v1.size()-1].fr;

		else
		y2=v1[v1.size()-2].fr;
	}

	forr(i,0,v.size()){
		if(v[i].fr!=x1 && v[i].fr!=x2 && v[i].se!=y1 && v[i].se!=y2){
			cs(v[i].fr);
			cs(v[i].se);
			re 0;
		}

		if(v[i].fr<x1 || v[i].fr>x2 || v[i].se<y1 || v[i].se>y2){
			cs(v[i].fr);
			cs(v[i].se);
			re 0;
		}
	}

	re 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
  int check(int a,int b,int minx,int miny,int maxx,int maxy,vector<int>&x,vector<int>&y,int n){
    int count=0;
    // cout<<a<<b<<minx<<miny<<maxx<<maxy<<endl;
    int max1=0,min1=0,max2=0,min2=0;
      for(int i=0;i<x.size();i++){
        if(x[i]==a && y[i]==b)continue;
          else if(x[i]>=minx && x[i]<=maxx && y[i]>=miny && y[i]<=maxy && (x[i]==maxx || x[i]==minx || y[i]==miny ||y[i]==maxy)){
             if(x[i]==minx)min1++;
             if(x[i]==maxx)max1++;
             if(y[i]==miny)min2++;
             if(y[i]==maxy)max2++;
          }
          else {
            count++;
            break;
          }
      }
      // cout<<min1<<max1<<min2<<max2<<endl;
      if(count==0 && min1>=n && min2>=n && max1>=n && max2>=n)return 1;

      else return 0;
  }

int main(){
 // freopen("input.txt","r",stdin);//freopen("result.txt","w",stdout);
    int t=1;
    while(t--){
       int n;
       cin>>n;
       vector<int>x(4*n+1);
       vector<int>y(4*n+1);
       for(int i=0;i<4*n+1;i++){
         cin>>x[i]>>y[i];
       }

       for(int i=0;i<4*n+1;i++){
         int minx=INT_MAX,miny=INT_MAX,maxx=INT_MIN,maxy=INT_MIN;
           for(int j=0;j<4*n+1;j++){
             if(j==i)continue;
             else {
                 if(minx>x[j])minx=x[j];
             }
           }

             for(int j=0;j<4*n+1;j++){
             if(j==i)continue;
             else {
                 if(miny>y[j])miny=y[j];
             }
           }

             for(int j=0;j<4*n+1;j++){
             if(j==i)continue;
             else {
                 if(maxx<x[j])maxx=x[j];
             }
           }

             for(int j=0;j<4*n+1;j++){
             if(j==i)continue;
             else {
                 if(maxy<y[j])maxy=y[j];
             }
           }
         int ans=check(x[i],y[i],minx,miny,maxx,maxy,x,y,n);
         if(ans==1){
           cout<<x[i]<<" "<<y[i]<<endl;
           return 0;
         }
       }
    }
    return 0;
}

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define rep(i, a, b) for (int (i) = (a); (i) < (b); ++(i))
#define per(i, a, b) for (int (i) = (a); (i) >= (b); --(i))
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define ff first
#define ss second
#define sz(x) ((int) x.size())
#define rd(type, ...) type __VA_ARGS__; sc(__VA_ARGS__)
#define rda(a, n) rep(i, 0, n) cin >> a[i];
#define rdaa(a, n, m) rep(i, 0, n) rep(j, 0, m) cin >> a[i][j];
#define rdv(type, v, n) vector<type> v(n); rep(__ii, 0, n) cin >> v[__ii]
#define rdm(type, v, h, w) vector<vector<type>> v(h, vector<type>(w)); rep(__ii, 0, h) rep(__jj, 0, w) cin >> v[__ii][__jj]
#define rdv2(type, n, ...)std::vector<type> __VA_ARGS__;MACRO_rdv2_Init(n, __VA_ARGS__); for(int w_=0; w_<n; ++w_){MACRO_rdv2_Scan(w_, __VA_ARGS__);}
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "] : ", debug_out(__VA_ARGS__)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define err2(x) {wr(x); return;}
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
// typedef tree<int, null_type, less, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key (k) : Number of items strictly smaller than k .
// find_by_order(k) : K-th element in a set (counting from zero).
void rset();
void init_test();
void solve();
signed main() {ios::sync_with_stdio(false); cin.tie(0);
  cout << fixed; cout.precision(20); init_test(); return 0;}
template<typename T> void chmin(T &a, T b) {if (a > b) a = b;}
template<typename T> void chmax(T &a, T b) {if (a < b) a = b;}
template<typename T> void MACRO_rdv2_Init(int n, T& t) { t.resize(n); }
template<typename First, typename... Rest> void MACRO_rdv2_Init(int n, First& first, Rest& ...rest) { first.resize(n); MACRO_rdv2_Init(n, rest...); }
template<typename T> void MACRO_rdv2_Scan(int p, T& t) { std::cin >> t[p]; }
template<typename First, typename... Rest> void MACRO_rdv2_Scan(int p, First& first, Rest& ...rest) { std::cin >> first[p]; MACRO_rdv2_Scan(p, rest...); }
template<typename T> void wrv(const vector<T> &v) {rep(__ii, 0, sz(v)) {if (__ii) cout << ' '; cout << v[__ii];} cout << '\n';}
template<typename T> void wrm(const vector<vector<T>> &v) {rep(__ii, 0, sz(v)) {rep(__jj, 0, v[__ii].size()) {if (__jj) cout << ' '; cout << v[__ii][__jj];} cout << '\n';}}
template<typename T> void sc(T& x) {cin >> x;}
template<typename Head, typename... Tail> void sc(Head& head, Tail&... tail) {cin >> head; sc(tail...);}
template<typename T> void wr(const T& x) {cout << x << '\n';}
template<typename Head, typename... Tail> void wr(const Head& head, const Tail&... tail) {cout << head << ' '; wr(tail...);}
template<typename T> void wrf(const T& x) {cout << x << endl;}
template<typename Head, typename... Tail> void wrf(const Head& head, const Tail&... tail) {cout << head << ' '; wrf(tail...);}
template<typename T> void debug_out(const T& x) {cerr << x << '\n';}
template<typename Head, typename... Tail> void debug_out(const Head& head, const Tail&... tail) {cerr << head << ' '; debug_out(tail...);}
template<typename... T> void err(const T&... cod) {wr(cod...); exit(0);}

void solve() {
  rd(int, n);
  rdv2(int, 4 * n + 1, x, y);
  int mnx = 2e9, mxx = -2e9;
  int mny = 2e9, mxy = -2e9;
  rep(i, 0, 4 * n + 1) {
    // dbg(x[i], y[i], count(all(x), x[i]), count(all(y), y[i]));
    if (count(all(x), x[i]) >= 2) {
      chmin(mnx, x[i]);
      chmax(mxx, x[i]);
    }
    if (count(all(y), y[i]) >= 2) {
      chmin(mny, y[i]);
      chmax(mxy, y[i]);
    }
  }
  // dbg(mnx, mxx, mny, mxy);
  rep(i, 0, 4 * n + 1) {
    if (x[i] < mnx) err(x[i], y[i]);
    if (x[i] > mxx) err(x[i], y[i]);
    if (y[i] < mny) err(x[i], y[i]);
    if (y[i] > mxy) err(x[i], y[i]);
    if (x[i] == mnx) continue;
    if (x[i] == mxx) continue;
    if (y[i] == mny) continue;
    if (y[i] == mxy) continue;
    wr(x[i], y[i]);
  }
  // rset();
}

void init_test() {
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  int qq = 1;
  // cin >> qq;
  while (qq--) solve();
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>

using namespace std;

const int Maxn = 1e5+10;
const int INF = 0x3f3f3f3f;
const long long LINF = 1e18;
const double eps = 1e-6;

pair<int, int> p[Maxn];

int main(void)
{
	int n;
	scanf("%d", &n);
	for(int i = 0; i < 4*n+1; ++i) scanf("%d%d", &p[i].first, &p[i].second);
	for(int i = 0; i < 4*n+1; ++i) {
		int left, right, up, down;
		left = down = INF;
		right = up = -INF;
		for(int j = 0; j < 4*n+1; ++j) {
			if(j == i) continue;
			left = min(left, p[j].first);
			right = max(right, p[j].first);
			down = min(down, p[j].second);
			up = max(up, p[j].second);
		}
		int c1, c2, c3, c4;
		c1 = c2 = c3 = c4 = 0;
		bool ok = true;
		for(int j = 0; j < 4*n+1; ++j) {
			if(j == i) continue;
			if(p[j].first == left) c1++;
			else if(p[j].first == right) c2++;
			if(p[j].second == down) c3++;
			else if(p[j].second == up) c4++;
			if((p[j].first == left || p[j].first == right) && (down <= p[j].second && p[j].second <= up)) {
				continue;
			}
			if((p[j].second == down || p[j].second == up) && (left <= p[j].first && p[j].first <= right)) {
			//	if(p[j].second == up) cout << p[j].first << " " << p[j].second << endl;
			//	p[j].second == down ? c3++ : c4++;
				continue;
			}
			ok = false; break;
		}
	//	cout << left << " " << right << " " << down << " " << up << endl;
	//	cout << p[i].first << " " << p[i].second << endl;
	//	cout << c1 << " " << c2 << " " << c3 << " " << c4 << endl;
		if(ok && c1 >= n && c2 >= n && c3 >= n && c4 >= n) {
			printf("%d %d\n", p[i].first, p[i].second);
			return 0;
		}
	}
	return 0;
 }

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

void boost()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

int main()
{
    boost();
    ll x,y,i,j,k,n;
    cin>>n;
    vector<pair<ll,ll>> p;
    for(i=0;i<4*n+1;i++)
    {
        cin>>x>>y;
        p.push_back({x,y});
    }
    sort(p.begin(),p.end());
    reverse(p.begin(),p.end());
    k=p.size();
    map<ll,ll> mp;
    ll x1,y1,cnt,cnt1,cnt2,cnt3;
    for(i=0;i<k;i++)
    {
        cnt=0;
        cnt1=0;
        cnt2=0;
        cnt3=0;
        set<ll> sx,sy;
        for(j=0;j<k;j++)
        {
            if(i==j)
            continue;
            sx.insert(p[j].first);
            sy.insert(p[j].second);
        }
        x=*sx.begin();
        x1=*(--sx.end());
        y=*sy.begin();
        y1=*(--sy.end());
        //cout<<x<<" "<<x1<<" "<<y<<" "<<y1<<endl;
        if(x1-x!=y1-y)
        continue;
        ll flag=0;
        for(j=0;j<k;j++)
        {
            if(i==j)
            continue;
            if((p[j].first==x||p[j].first==x1)||(p[j].second==y||p[j].second==y1))
            {
                if(p[j].first==x)
                cnt++;
                if(p[j].first==x1)
                cnt1++;
                if(p[j].second==y)
                cnt2++;
                if(p[j].second==y1)
                cnt3++;
            }
            else
            flag=1;
        }
        //cout<<cnt<<" "<<i<<endl;
        if(cnt>=n&&cnt1>=n&&cnt2>=n&&cnt3>=n&&flag==0)
        {
            cout<<p[i].first<<" "<<p[i].second<<endl;
            return 0;
        }
    }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

const long long NMAX  = 1e6;

long long x[NMAX + 5], y[NMAX+5];
pair<long long,long long> base[NMAX + 5];
long long sum[NMAX+2];
long long N, M;
map<pair<int,int>, bool> mp;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> N;
    int R = 4 * N + 1;
    for( int i = 1;  i <= R;  ++i ) {
        cin >> x[i] >> y[i];
        mp[ {x[i], y[i]} ] = 1;
    }
    for( int xx = 0;  xx <= 50;  ++xx ) {
        for(int yy = 0;  yy <= 50;  ++yy ) {
            for( int rad = 50;  rad >= 2;  --rad ) {
                map<pair<int,int>, bool> used;
              //  bool ok = 1;
                for( int i = 0;  i < rad;  ++i ) {
                    used[{xx + i, yy}] = used[{xx + rad, yy + i}] = used[{xx + rad - i, yy + rad}] = used[{xx, yy + rad - i}] = 1;
                }
              ///  if( !ok ) continue;
                int cnt = 0;
                for( int i = 1;  i <= R;  ++i ) {
                    if( !used[ {x[i], y[i]} ] )
                        ++cnt;
                }
                if( cnt != 1 )
                    continue;

                for( int i = 1;  i <= R;  ++i ) {
                    if( !used[ {x[i], y[i]} ] )
                        {
                            cout << x[i] << ' ' << y[i] << '\n';
                            return 0;
                        }
                }
            }
        }
    }
    return 0;
}

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

int main()
{
    //freopen("in.txt", "r", stdin);
    int n;
    scanf("%d", &n);
    int x[4 * n + 3], y[4 * n + 3];
    map<int, int>mp, mp2;
    for(int i = 0; i < 4 * n + 1; i++) {
        scanf("%d %d", &x[i], &y[i]);
        mp[x[i]]++;
        mp2[y[i]]++;
    }
    int mnx = -1, mxx = 0;
    for(auto it : mp) {
        if(it.second > 1 && mnx == -1) mnx = it.first;
        if(it.first >= mxx && it.second > 1) mxx = it.first;
    }
    int mny = -1, mxy = 0;
    for(auto it : mp2) {
        if(it.second > 1 && mny == -1) mny = it.first;
        if(it.first >= mxy && it.second > 1) mxy = it.first;
    }
//    for(int i = 0; i < 4 * n + 1; i++)
//    printf("%d %d %d\n", i, x[i], y[i]);
    for(int i = 0; i < 4 * n + 1; i++) {
        //printf("%d %d %d\n", i, x[i], y[i]);
        bool ck = false;
        if(x[i] == mnx || x[i] == mxx) {
            if(y[i] >= mny && y[i] <= mxy) {
                ck = true;
            }
        }
        if(!ck)
        if(y[i] == mny || y[i] == mxy) {
            if(x[i] >= mnx && x[i] <= mxx) {
                ck = true;
            }
        }
        if(!ck) {
            printf("%d %d\n", x[i], y[i]);
            break;
            //return 0;
        }
    }
}

#pragma gcc optimize (o3)
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define S second
#define F first
#define ll long long
#define ld long double
#define U unsigned
#define pi acos(-1)
#define P complex<ld>

using namespace std;

const int N = 1e5+5, bSize = sqrt(N), M = 1e4+5;

int main(){
	int n;
	cin >> n;
	vector<pair<int, int> > v;
	map <int, int> freqX, freqY;
	for(int i = 0 ; i <= n * 4 ; i++){
		int a, b;
		cin >> a >> b;
		v.emplace_back(a, b);
		freqX[a]++;
		freqY[b]++;
	}
	vector<int> sx, sy;
	for(auto i:freqX) if(i.S > 1) sx.push_back(i.F);
	for(auto i:freqY) if(i.S > 1) sy.push_back(i.F);
	sort(sx.begin(), sx.end());
	sort(sy.begin(), sy.end());
	int ex = sx.size() - 1;
	int ey = sy.size() - 1;
	for(auto i:v){
		if((i.F == sx[0] or i.F == sx[ex]) and i.S <= sy[ey] and i.S >= sy[0]){continue;}
		else if((i.S == sy[0] or i.S == sy[ey]) and i.F <= sx[ex] and i.F >= sx[0]){continue;}
		else return cout<<i.F<<" "<<i.S, 0;
	}
}

//#pragma GCC optimize("Ofast")   	//Comment optimisations for interactive proreqlems (use endl)
//#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>

using namespace std;

#define  fastio         ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(10);
#define  randomINIT     mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define  mset(x,val)    memset(x,val,sizeof(x))
#define  newl           cout<<"\n"
#define  pb             push_back

typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   MOD   =  1e+9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   MAXN  =  2e+3+500;
const ll   MAXN1  =  1e+5+8;
int main()
{

	ll n;
	cin >> n;

	vpll v;
	map<ll, ll> xc;
	map<ll, ll> yc;

	for(int i = 0; i < 4*n+1; i++)
	{
		ll x, y;
		cin >> x >> y;

		v.pb(make_pair(x, y));
		xc[x]++;
		yc[y]++;
	}

	ll xlow = INF, xhigh = 0, ylow = INF, yhigh = 0;
	for(auto it:xc)
	{
		if(it.second >= n)
		{
			xlow = min(xlow, it.first);
			xhigh = max(xhigh, it.first);
		}
	}

	for(auto it:yc)
	{
		if(it.second >= n)
		{
			ylow = min(ylow, it.first);
			yhigh = max(yhigh, it.first);
		}
	}

	for(auto coord:v)
	{
		if((coord.first == xlow or coord.first == xhigh) and coord.second >= ylow and coord.second <= yhigh)
			continue;
		if((coord.second == ylow or coord.second == yhigh) and coord.first >= xlow and coord.first <= xhigh)
			continue;
		cout << coord.first << " " << coord.second << endl;
		break;

	}
}

//NAME-DEEPESH BHATT
//Institute-IIT Dhanbad
//MOTTO-THINK FIRST,CODE LATER

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007  ;
#define endl '\n'
#define pb push_back
#define mp make_pair

//Check for signed int overflow
// use __builtin_popcount(num) to calculate no.of setbits in num
//s.lower_bound() works in O(logn) whereas lower_bound(s.begin(),s.end(),x) works in O(n)
//      if(!lazy)
//         solve 1600+(rating) problems in codeforces.
//      else
//         solve 1400+(rating) problems in codeforces.

ll gcd(ll a,ll b)
{
    if(b==0)
        return a;
    else
        return gcd(b,a%b);
}
ll lcm(ll a ,ll b)
{
    return a/gcd(a,b)*b;
}
ll power(ll a,ll n){
    if (n == 0)
        return 1;
    ll p = power(a, n / 2);
    p = (p * p)%MOD;
    if (n % 2)
        return (p * a)%MOD;
    else
        return p%MOD;
}

/*vector<bool>is_prime(1000001,true);
void sieve(){
    is_prime[0]=is_prime[1]=false;
    is_prime[2]=true;
    for(int i=2;i*i<=1000000;i++){
        if(is_prime[i]){
            for(int j=i*i;j<=1000000;j+=i){
                is_prime[j]=false;
            }
        }
    }
}*/
pair<int,char>count_vowels(const string& a){
    ll count=0;
    char c;
    for(char i : a){
        if(i=='a'||i=='e'||i=='i'||i=='o'||i=='u'){
            count++;
            c=i;
        }
    }
    return {count,c};
}

int32_t main()
{
    ios_base::sync_with_stdio(false);    //for fast I/O operation
    cin.tie(nullptr);
    ll test=1;
    /*cin>>test;*/
    while(test--) {
        ll n;
        cin>>n;
        vector<pair<ll,ll>>coord(4*n+1);
        set<pair<ll,ll>>s;
        for(ll i=0;i<4*n+1;i++){
            ll x,y;
            cin>>x>>y;
            coord[i]={x,y};
            s.insert({x,y});
        }
        pair<ll,ll>ans;
        for(ll i=0;i<4*n+1;i++){
            s.erase(coord[i]);
            map<ll,ll>mx,my;
            for(auto x:s){
                mx[x.first]++;
                my[x.second]++;
            }
            ll min_x=50,min_y=50,max_x=0,max_y=0;
            for(auto x:mx){
                /*cout<<x.first<<" "<<x.second<<endl;*/
                min_x=min(min_x,x.first);
                max_x=max(max_x,x.first);
            }
            /*cout<<endl;*/
            for(auto x:my){
                /*cout<<x.first<<" "<<x.second<<endl;*/
                min_y=min(min_y,x.first);
                max_y=max(max_y,x.first);
            }
            /*cout<<endl<<endl;*/
            ll common=0;
            for(auto x:s){
                if(x.first==min_x&&x.second==min_y){
                    common++;
                }
                else if(x.first==min_x&&x.second==max_y){
                    common++;
                }
                else if(x.first==max_x&&x.second==min_y){
                    common++;
                }
                else if(x.first==max_x&&x.second==max_y){
                    common++;
                }
            }
            /*cout<<common<<endl;*/
            if((mx[min_x]+mx[max_x]+my[min_y]+my[max_y]-common==4*n)&&((max_x-min_x)==(max_y-min_y))){
                ans=coord[i];
                break;
            }
            else{
                s.insert(coord[i]);
            }
        }
        cout<<ans.first<<" "<<ans.second;
    }
    return 0;
}

#include <iostream>

using namespace std;

int main() {

    int n, i, m, j, x, y, mxx, mnx, mxy, mny;
    cin >> n;

    m = 4*n + 1;
    int px[51]{};
    int py[51]{};
    int p[m][2]{};

    mxx = mxy = -1;
    mnx = mny = 51;
    for (i = 0; i < m; ++i) {
        cin >> x >> y;
        p[i][0] = x;
        p[i][1] = y;
        ++px[x];
        ++py[y];
        if (x < mnx)
            mnx = x;
        if (x > mxx)
            mxx = x;
        if (y < mny)
            mny = y;
        if (y > mxy)
            mxy = y;
    }

    // set real borders
    if (px[mnx] == 1) {
        ++mnx;
        while (px[mnx] == 0)
            ++mnx;
    }
    else if (px[mxx] == 1) {
        --mxx;
        while (px[mxx] == 0)
            --mxx;
    }
    if (py[mny] == 1) {
        ++mny;
        while (py[mny] == 0)
            ++mny;
    }
    else if (py[mxy] == 1) {
        --mxy;
        while (py[mxy] == 0)
            --mxy;
    }

    // check for anomaly
    for (i = 0; i < m; ++i) {
        x = 0;
        if (p[i][0] == mnx || p[i][0] == mxx)
            if (p[i][1] >= mny && p[i][1] <= mxy)
                ++x;
        if (p[i][1] == mny || p[i][1] == mxy)
            if (p[i][0] >= mnx && p[i][0] <= mxx)
                ++x;
        if (x == 0) {
            cout << p[i][0] << ' ' << p[i][1] << '\n';
            break;
        }
    }

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

struct P
{
        int x;
        int y;
};

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int n;
        cin >> n;
        vector <P> a(4 * n + 1);
        for (int i = 0; i < 4 * n + 1; i++)
                cin >> a[i].x >> a[i].y;
        for (int i = 0; i < 4 * n + 1; i++)
        {
                int xmi, ymi;
                xmi = ymi = (1 << 30);
                int xma, yma;
                xma = yma = -(1 << 30);
                for (int j = 0; j < 4 * n + 1; j++)
                {
                        if (i == j)
                                continue;
                        xmi = min(xmi, a[j].x);
                        ymi = min(ymi, a[j].y);
                        xma = max(xma, a[j].x);
                        yma = max(yma, a[j].y);
                }
                int c1, c2, c3, c4;
                c1 = c2 = c3 = c4 = 0;
                bool ok = 1;
                for (int j = 0; j < 4 * n + 1; j++)
                {
                        if (i == j)
                                continue;
                        int f = c1 + c2 + c3 + c4;
                        c1 += (a[j].x == xmi);
                        c2 += (a[j].y == ymi);
                        c3 += (a[j].x == xma);
                        c4 += (a[j].y == yma);
                        int s = c1 + c2 + c3 + c4;
                        if (f == s)
                                ok = 0;
                }
                if (ok && min(min(c1, c2), min(c3, c4)) >= n)
                {
                        cout << a[i].x << " " << a[i].y << "\n";
                        return 0;
                }
        }

        return 0;
}

#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define SpeedForce ios_base::sync_with_stdio(0), cin.tie(0)
#define forn(i, n) for(int i = 1; i <= n; i++)
#define rep(i, x, y) for(int i = x; i <= y; i++)
#define Z size()
#define pii pair<int, int>
#define ll long long
#define ull unsigned long long
#define ld long double
#define mii map<int, int>
#define all(x) x.begin(), x.end()

using namespace std;

const int mod = 1e9 + 7;

int cntx[51], cnty[51];

int main() {
    int n;
    cin >> n;
    int x1 = INT_MAX, x2 = INT_MIN, y1 = INT_MAX, y2 = INT_MIN;

    vector <pii> v;
    for(int i = 0; i <= 4 * n; i++) {
        int x, y;
        cin >> x >> y;
        v.pb(mp(x, y));
        cntx[x]++;
        cnty[y]++;
        if(cntx[x] > 1) x1 = min(x1, x), x2 = max(x2, x);
        if(cnty[y] > 1) y1 = min(y1, y), y2 = max(y2, y);
    }

    //cout << endl;
    //cout << x1 << ' ' << x2 << endl << y1 << ' ' << y2, exit(0);

    for(int i = 0; i < v.size(); i++) {
        if(v[i].F < x1 || v[i].F > x2 || v[i].S < y1 || v[i].S > y2)
            cout << v[i].F << ' ' << v[i].S, exit(0);
        if(v[i].F != x1 && v[i].F != x2 && v[i].S != y1 && v[i].S != y2)
            cout << v[i].F << ' ' << v[i].S, exit(0);
    }

}

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<map>
#include<bitset>
#include<stack>
#include<set>
#include<vector>
#include <time.h>
#include<string.h>
using namespace std;

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

const int maxn = 1e5+5;
const int Mod=1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e=exp(1);
const db PI = acos(-1);
const db ERR = 1e-10;

#define Se second
#define Fi first
#define pb push_back
#define ok cout<<"OK"<<endl
#define dbg(x) cout<<#x<<" = "<< (x)<< endl
#define dbg2(x1,x2) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<endl
#define dbg3(x1,x2,x3) cout<<#x1<<" = "<<x1<<" "<<#x2<<" = "<<x2<<" "<<#x3<<" = "<<x3<<endl
struct P
{
    int x,y;
}p[maxn];
int n;
int main()
{
    //ios::sync_with_stdio(false);
    //freopen("a.txt","r",stdin);
    //freopen("b.txt","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=4*n+1;i++) scanf("%d %d",&p[i].x,&p[i].y);
    for(int i=0;i<=50;i++)
    {
        for(int j=i+1;j<=50;j++)
        {
            for(int k=0;k<=50;k++)
            {
                for(int l=k+1;l<=50;l++)
                {
                    int no = 0;
                    int flag = -1;
                    int a=0,b=0,c=0,d=0;
                    for(int t=1;t<=4*n+1;t++)
                    {
                        if(p[t].x==i&&p[t].y>=k&&p[t].y<=l) a++;
                        else if(p[t].x==j&&p[t].y>=k&&p[t].y<=l) b++;
                        else if(p[t].y==k&&p[t].x>=i&&p[t].x<=j) c++;
                        else if(p[t].y==l&&p[t].x>=i&&p[t].x<=j) d++;
                        else
                        {
                            flag=t;
                            no++;
                        }
                    }
                    if(no==1)
                    {
                        printf("%d %d\n",p[flag].x,p[flag].y);
                        return 0;
                    }
                }
            }
        }
    }
    //cout << "time: " << (long long)clock() * 1000 / CLOCKS_PER_SEC << " ms" << endl;
    return 0;
}

#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define FOR(x,n) for(int x=0;x<n;x++)

int n;
ii c[50];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    n = n*4+1;
    int mix = 999, miy = 999;
    FOR(i,n) {
        cin >> c[i].first >> c[i].second;
        mix = min(mix,c[i].first);
        miy = min(miy,c[i].second);
    }
    int zx = 0;
    int zy = 0;
    int dx,dy;
    FOR(i,n) {
        c[i].first -= mix;
        c[i].second -= miy;
        if(c[i].first == 0) {
            zx++;
            dx = i;
        }
        if(c[i].second == 0) {
            zy++;
            dy = i;
        }
    }
    if(zx == 1) {
        cout << c[dx].first + mix << " " << c[dx].second + miy <<endl;
        return 0;
    }
    if(zy == 1) {
        cout << c[dy].first + mix << " " << c[dy].second + miy << endl;
        return 0;
    }

    FOR(i,51) {
        FOR(j,51) {
            int e = -1;
            bool b = false;
            int s[4] = {0};
            FOR(k,n) {
                if(!((c[k].first == 0 || c[k].first == i) && c[k].second >= 0 && c[k].second <= j
                        || (c[k].second == 0 || c[k].second == j) && c[k].first >= 0 && c[k].first <= i)) {
                    if(e != -1) {
                        b = true;
                        break;
                    } else {
                        e = k;
                    }
                } else {
                    if(c[k].first == 0 && c[k].second >= 0 && c[k].second <= j) s[0]++;
                    if(c[k].first == i && c[k].second >= 0 && c[k].second <= j) s[1]++;
                    if(c[k].second == 0 && c[k].first >= 0 && c[k].first <= i)  s[2]++;
                    if(c[k].second == j && c[k].first >= 0 && c[k].first <= i)  s[3]++;
                }
            }

            if(!b && s[0] >= n/4 && s[1] >= n / 4 && s[2] >= n / 4 && s[3] >= n / 4) {
                cout << c[e].first + mix << " " << c[e].second  + miy << endl;
            }
        }
    }

    // Husk add mix, miy
    return 0;
}

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

map<int, vector<int>> X, Y;

int main() {
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    for(int i = 0; i <= 4 * n; i++) {
        int x, y;
        cin >> x >> y;
        X[x].push_back(y);
        Y[y].push_back(x);
    }
    if((X.begin() -> second).size() == 1)
        return printf("%d %d\n", X.begin() -> first, (X.begin() -> second).front()), 0;
    if((X.rbegin() -> second).size() == 1)
        return printf("%d %d\n", X.rbegin() -> first, (X.rbegin() -> second).front()), 0;
    if((Y.begin() -> second).size() == 1)
        return printf("%d %d\n", (Y.begin() -> second).front(), Y.begin() -> first), 0;
    if((Y.rbegin() -> second).size() == 1)
        return printf("%d %d\n", (Y.rbegin() -> second).front(), Y.rbegin() -> first), 0;
    int x1 = X.begin() -> first, x2 = X.rbegin() -> first;
    int y1 = Y.begin() -> first, y2 = Y.rbegin() -> first;
    for(auto &cur : X) if(cur.first != x1 && cur.first != x2) {
        for(int y : cur.second) if(y != y1 && y != y2)
            return printf("%d %d\n", cur.first, y), 0;
    }
    return 19260817;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

const long long MOD = 1000000007LL;
const long long INF = 1e18;

int GCD(int a, int b){return b == 0 ? a : GCD(b, a % b);}
long long fast_exp(long long base, long long exp, long long mod = MOD) {
    long long tot = 1;
    for(;exp > 0;exp >>= 1) {
       if((exp & 1) == 1) tot = tot * base % mod;
       base = base * base % mod;
    }
    return tot;
}
long long mult_mod(long long base, long long exp, long long mod = MOD) {
    long long tot = 0;
    for(;exp > 0;exp >>= 1){
       if((exp & 1) == 1) tot = (tot + base) % mod;
       base = base * 2 % mod;
    }
    return tot;
}

struct chash {
    static uint64_t splitmix64(uint64_t x) {x += 0x8e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf54876d1ce4e5b9; x = (x ^ (x >> 27)) * 0x94d049bb133111eb; return x ^ (x >> 31);}
    size_t operator()(uint64_t x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x + FIXED_RANDOM);}
    size_t operator()(pair<uint64_t,uint64_t> x) const { static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count(); return splitmix64(x.first + FIXED_RANDOM)^(splitmix64(x.second + FIXED_RANDOM) >> 1);}
};

pair<int, int> points[42];

int main(){

    cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);

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

    int n; cin >> n;

    n = 4 * n + 1;

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

    for(int lx = 0; lx <= 50; ++lx){
        for(int hx = lx; hx <= 50; ++hx){
            for(int ly = 0; ly <= 50; ++ly){
                for(int hy = ly; hy <= 50; ++hy){

                    int bad = -1;

                    for(int j = 0; j < n && bad != -2; ++j){
                        int x = points[j].first, y = points[j].second;
                        if((lx < x && x < hx && ly < y && y < hy) || !(lx <= x && x <= hx && ly <= y && y <= hy)){
                            if(bad != -1)
                                bad = -2;
                            else
                                bad = j;
                        }
                    }

                    if(bad > -1){
                        cout << points[bad].first << " " << points[bad].second << "\n";
                        return 0;
                    }
                }
            }
        }
    }

    return 0;
}

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

int n,x[60],y[60];

signed main()
{
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		cin>>x[i]>>y[i];
	}
	for(int i=0;i<=50;i++){
		for(int j=0;j<=50;j++){
			for(int k=1;k<=50;k++){
				int x11=i,y11=j;
				int x22=i+k,y22=j+k;
				int cnt=0,cntx=0,cnty=0;
				if(x22>50||y22>50) continue;
				for(int l=1;l<=4*n+1;l++){
					if(x[l]==x11&&y[l]>=y11&&y[l]<=y22){
						continue;
					}
					if(y[l]==y11&&x[l]>=x11&&x[l]<=x22){
						continue;
					}
					if(x[l]==x22&&y[l]>=y11&&y[l]<=y22){
						continue;
					}
					if(y[l]==y22&&x[l]>=x11&&x[l]<=x22){
						continue;
					}
					cnt++;cntx=x[l];cnty=y[l];
				}
				if(cnt==1){
					cout<<cntx<<" "<<cnty<<endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

#include <bits/stdc++.h>
#define M 1000000007
#define U 998244353
#define int long long
#define sz(c) (int)c.size()
#define fr first
#define ll long long
#define sc second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a ; i<n ; i++)
#define r0 return 0;
#define N 1000005
#define U 998244353
#define bs binary_search
#define endl '\n'
#define FILEIO     freopen("input.txt","r",stdin); freopen("output.txt","w", stdout);
#define PI 3.1415926535
#define INF LLONG_MAX-5
using namespace std;
int po(int n, int exp){
    int prod=1;
    rep(i,0,exp)
        prod*=n;
    return prod;
}
int mnx=INT_MAX,mny=INT_MAX,mxx=INT_MIN,mxy=INT_MIN;
bool bound(int x,int y){
    if(x==mnx&&y>=mny&&y<=mxy) return 1;
    if(x==mxx&&y>=mny&&y<=mxy) return 1;
    if(y==mny&&x>=mnx&&x<=mxx) return 1;
    if(y==mxy&&x>=mnx&&x<=mxx) return 1;
    return 0;
}
signed main()
{
    ios_base::sync_with_stdio(0);
    // cin.tie(0);
    // cout.tie(0);
    int TESTS=1;
    // cin>>TESTS;
    while(TESTS--)
    {
        int n;
        cin>>n;
        map<int,int> m1,m2;
        pair<int,int> c[4*n+1];
        rep(i,0,4*n+1){
            int x,y;
            cin>>x>>y;
            c[i] = {x,y};
            m1[x]++;
            m2[y]++;
        }
        for(auto j:m1){
            if(j.sc>=n){
                mnx = min(mnx,j.fr);
                mxx = max(mxx,j.fr);
            }
        }
        for(auto j:m2){
            if(j.sc>=n){
                mny = min(mny,j.fr);
                mxy = max(mxy,j.fr);
            }
        }
        rep(i,0,4*n+1){
            if(!bound(c[i].fr,c[i].sc)){
                cout<<c[i].fr<<" "<<c[i].sc;
            }
        }

    }
}

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
struct node
{
	int x,y;
};
vector<node>G,ans;
int check(int x1,int y1,int x2,int y2){
	//int x1=100,y1=100,x2=-1,y2=-1;
	ans.clear();
	//ans.pb({xx,yy});
	for(int i=0;i<G.size();++i){
		int xx=G[i].x,yy=G[i].y;
		if(xx==x1){
			if(y1<=yy&&yy<=y2) continue;
			else {
				ans.pb({xx,yy});
			}
		}
		else if(xx==x2){
			if(y1<=yy&&yy<=y2) continue;
			else {
				ans.pb({xx,yy});
			}
		}
		else if(yy==y1){
			if(x1<=xx&&xx<=x2) continue;
			else{
				ans.pb({xx,yy});
			}
		}
		else if(yy==y2){
			if(x1<=xx&&xx<=x2) continue;
			else{
				ans.pb({xx,yy});
			}
		}
		else ans.pb({xx,yy});
	}
	if(ans.size()==1) return 1;
	return 0;
}
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		int u,v;
		cin>>u>>v;
		G.push_back({u,v});
	}
	for(int i=0;i<=50;++i){
		for(int j=0;j<=50;++j){
			for(int k=1;k<=50;k++){
				int x=i+k;
				int y=j+k;
				if(x>50||y>50) continue;
				if(check(i,j,x,y)){
					printf("%d %d\n",ans[0].x,ans[0].y);
					return 0;
				}
			}
		}
	}

	return 0;
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <ctime>
#include <vector>
#include <set>
#include <iterator>
#include <map>

#define ll long long
#define ld long double
#define y1 abc
#define endl '\n'
#define fi first
#define se second
#define m_p make_pair
#define pb push_back
#define MAXLL 9000000000000000000LL
#define MAXINT 2000000000
#define MINLL -9000000000000000000LL
#define MININT -2000000000
#define stoi aaaaavasd
#define pll pair < ll, ll >

using namespace std;

const ld pi = acos(-1);
const ll md = 1e9 + 7;

ll n, x[45], y[45], i, mxx, j, k, mnx, mxy, mny, l, r, u, d;

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

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

    cin >> n;

    for (i = 1; i <= n * 4 + 1; i++){
        cin >> x[i] >> y[i];
    }

    for (i = 1; i <= n * 4 + 1; i++){
        mxx = mxy = k = l = r = u = d = 0;
        mnx = mny = MAXLL;

        for (j = 1; j <= n * 4 + 1; j++){
            if (j == i) continue;

            mxx = max(mxx, x[j]);
            mxy = max(mxy, y[j]);
            mny = min(mny, y[j]);
            mnx = min(mnx, x[j]);
        }

        for (j = 1; j <= n * 4 + 1; j++){
            if (i == j) continue;

            if (!((x[j] == mxx && y[j] >= mny && y[j] <= mxy) ||
                  (x[j] == mnx && y[j] >= mny && y[j] <= mxy) ||
                  (y[j] == mxy && x[j] >= mnx && x[j] <= mxx) ||
                  (y[j] == mny && x[j] >= mnx && x[j] <= mxx))) k++;

            if (x[j] == mxx) r++;
            if (x[j] == mnx) l++;
            if (y[j] == mxy) u++;
            if (y[j] == mny) d++;
        }

        if (k == 0 && r >= n && d >= n && u >= n && l >= n) cout << x[i] << " " << y[i] << endl;
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
const ll MOD=1e9+7;
const ll N=100+5;
const ld pi=3.14159265359;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define setp setprecision
#define lwb lower_bound
void SRAND(){auto duration = std::chrono::system_clock::now().time_since_epoch();auto millis = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();srand(millis);}

ll n,x[N],y[N];
vector<pll> v;

bool ch(ll xa,ll ya,ll xb,ll yb,ll ty){
	REP(i,n){
		if(i==ty)continue;
		if(!(((x[i]==xa||x[i]==xb)&&((y[i]<=yb&&y[i]>=ya)||(y[i]>=yb&&y[i]<=ya)))||((y[i]==ya||y[i]==yb)&&((x[i]<=xb&&x[i]>=xa)||(x[i]<=xa&&x[i]>=xb)))))return 0;
	}
	return 1;
}

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>n;
	n=4*n+1;
	REP(i,n){
		cin>>x[i]>>y[i];
	}
	REP(xa,51)REP(ya,51)REP(xb,51)REP(yb,51){
		REP(k,n){
			if(ch(xa,ya,xb,yb,k)){
				cout<<x[k]<<" "<<y[k];return 0;
			}
		}
	}
	return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int p[100][2];

main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int q=(4*n)+1;
	int fx[51]={0};
	int fy[51]={0};
	for(int i=0;i<q;i++)
	{
		for(int j=0;j<2;j++)
		{
			cin>>p[i][j];
			if(j==0)
			fx[p[i][j]]++;
			else
			fy[p[i][j]]++;
		}
	}
	int xmin=-1,xmax=-1,ymin=-1,ymax=-1,i,t=-1;
	for(i=0;i<51;i++)
	{
		if(fx[i]>n-1)
		{
			xmin=i;
			break;
		}
	}
	for(i=xmin+1;i<51;i++)
	{
		if(fx[i]>n-1)
			xmax=i;
	}
	for(i=0;i<51;i++)
	{
		if(fy[i]>n-1)
		{
			ymin=i;
			break;
		}
	}
	for(i=ymin+1;i<51;i++)
	{
		if(fy[i]>n-1)
			ymax=i;

	}
	//cout<<xmin<<" "<<xmax<<" "<<ymin<<" "<<ymax<<endl;
	for(i=0;i<q;i++)
	{
		int a=p[i][0];
		int b=p[i][1];
		if((a==xmin || a==xmax) && b>ymin-1 && b<ymax+1)
		continue;
		else if((b==ymin || b==ymax) && a>xmin-1 && a<xmax+1)
		continue;
		else
		cout<<a<<" "<<b<<endl;
	}

}

#include<bits/stdc++.h>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
#define foru(i, n) for(int i = 1; i <= n; i++)
#define foru0(i, n) for(int i = 0; i < n; i++)
#define ford(i, n) for(int i = n; i >= 1; i--)
#define ford0(i, n) for(int i = n - 1; i >= 0; i--)
#define fors(i, a, b) for(int i = a; i <= b; i++)
#define endl "\n"
#define scv(a, b, c) #b#a#c;

using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vii;
typedef vector<pll> v2l;
typedef pair<char, int> pci;
typedef vector<pci> vci;

const int N = 1e6 + 1;
const int NN = 1e3 + 1;
const ll MOD = 1e9 + 7;
const ll oo = 1e18 + 7;
const int BASE = 10000;

void solve() {
    int n;
    cin >> n;
    int m = 4 * n + 1;
    vii a(m + 1);
    for(int i = 1; i <= m; i++) {
        cin >> a[i].fi >> a[i].se;
    }
    for(int i = 1; i <= m; i++) {
        int minx = 100, maxx = -1;
        int miny = 100, maxy = -1;
        for(int j = 1; j <= m; j++) {
            if(j != i) {
                maxx = max(maxx, a[j].fi);
                minx = min(minx, a[j].fi);
                maxy = max(maxy, a[j].se);
                miny = min(miny, a[j].se);
            }
        }
        int cnt = 0;
        for(int j = 1; j <= m; j++) {
            if(j != i) {
                if((a[j].fi == maxx || a[j].fi == minx) && (a[j].se >= miny && a[j].se <= maxy) ||
                   (a[j].se == miny || a[j].se == maxy) && (a[j].fi >= minx && a[j].fi <= maxx)) {
                    cnt++;
                }
            }
        }
        //cout << minx << " " << maxx << " " << miny << " " << maxy << " " << cnt << endl;
        if(cnt == m - 1 && maxx - minx == maxy - miny) {
            cout << a[i].fi << " " << a[i].se;
            return;
        }
    }
}

int main() {
    //#ifdef DEBUG
        //freopen("solve.inp", "r", stdin);
        //freopen("solve.out", "w", stdout);
    //#endif
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout.precision(10);
    solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
    return 0;
}

%:pragma GCC optimize(2)
%:pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define lll __int128
#define dd double
#define _i int
#define RE register
#define rep(i, l, r) for (RE int i = l; i <= r; i++)
#define req(i, l, r) for (RE int i = l; i >= r; i--)
#define range(i, l, r) rep(i, l, r - 1)
#define Be(s, t) memset(s, t, sizeof(s))
#define poly vector <int>
#define pii pair <int, int>
template <typename T> void read(T &x) { x = 0; int FF = 1; char op = getchar(); while (!isdigit(op)) { if (op == '-') FF = -1; op = getchar(); } while (isdigit(op)) { x = (x << 1) + (x << 3) + op - '0'; op = getchar(); } x *= FF; }
template <typename T> void print(T x) { if (x < 0) { putchar('-'); x = -x; } if (x < 1) return ; print(x / 10); putchar(x % 10 + '0'); }
template <typename T> void print(T x, char _tab) { print(x); putchar(_tab); }

const int maxn = 100005;
int a[maxn], b[maxn];
int l[maxn], r[maxn];
int n;
int q1, q2, cnt1, cnt2;
int x, y;
int pos[1005][1005];

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= 4 * n + 1; i++) {
    scanf("%d%d", &a[i], &b[i]);
    pos[a[i]][b[i]] = 1;
  }

  for (int la = 0; la <= 50; la++) {
    for (int lb = la + 1; lb <= 50; lb++) {
      for (int ra = 0; ra <= 50; ra++) {
        for (int rb = ra + 1; rb <= 50; rb++) {
          int xx, yy, tot = 0;
          for (int i = 1; i <= 4 * n + 1; i++) {
            if (a[i] == la && ra <= b[i] && b[i] <= rb) ;
            else if (a[i] == lb && ra <= b[i] && b[i] <= rb) ;
            else if (b[i] == ra && la <= a[i] && a[i] <= lb) ;
            else if (b[i] == rb && la <= a[i] && a[i] <= lb) ;
            else {
              tot++;
              xx = a[i], yy = b[i];
            }
          }

          if (tot == 1) {
            printf("%d %d\n", xx, yy);
            exit(0);
          }
        }
      }
    }
  }

  return 0;
}

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

#define int long long
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define endl "\n"
typedef long long ll;
typedef long double ld;
const int mod = 1000000007;

int power(int x,int y){int res=1;x=x%mod;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
int ncr(int n,int r){int res=1;if(r>n-r)r=n-r;for(int i=0;i<r;i++){res*=(n-i);res/=(i+1);}return res;}
int gcd(int a,int b){if (a==0)return b;return gcd(b%a,a);}
int lcm(int a,int b){return (a/gcd(a,b)*b);}
int max(int a,int b){int ans=a>b?a:b;return ans;}
int min(int a,int b){int ans=a<b?a:b;return ans;}
//cout<<fixed<<setprecision(8)<<x<<endl;
clock_t time_p=clock();
void rtime(){time_p=clock()-time_p;cerr<<"******************\nTime taken : "<<(double)(time_p)/CLOCKS_PER_SEC<<"\n";}

signed main()
{
	//fast;
    //int t=1; cin>>t; while(t--)
    {
    	int n;
    	cin>>n;
    	n=4*n+1;
    	vector<pair<int,int>> v(n);
    	for(int i=0;i<n;i++)
    		cin>>v[i].F>>v[i].S;
    	for(int i=0;i<n;i++)
    	{
    		vector<pair<int,int>> vc;
    		for(int j=0;j<n;j++)
    		{
    			if(i!=j)
    				vc.pb({v[j].F,v[j].S});
    		}
    		int nc=vc.size(),x1=51,y1=51,x2=-1,y2=-1,c=0;
    		for(int i=0;i<nc;i++)
			{
				x1=min(x1,vc[i].F);
				x2=max(x2,vc[i].F);
				y1=min(y1,vc[i].S);
				y2=max(y2,vc[i].S);
			}
			if(x2-x1!=y2-y1)
				continue;
			/*cout<<"******@@@********\n";
			for(int j=0;j<nc;j++)
				cout<<vc[j].F<<" "<<vc[i].S<<endl;*/
			//cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<endl;
			for(int j=0;j<nc;j++)
			{
				if(vc[j].F==x1 && vc[j].S>=y1 && vc[j].S<=y2)
					c++;
				else if(vc[j].F==x2 && vc[j].S>=y1 && vc[j].S<=y2)
					c++;
				else if(vc[j].S==y1 && vc[j].F>=x1 && vc[j].F<=x2)
					c++;
				else if(vc[j].S==y2 && vc[j].F>=x1 && vc[j].F<=x2)
					c++;
				//c++;
			}
			//cout<<"# "<<i<<" "<<c<<endl;
			if(c!=nc-1)
				return cout<<v[i].F<<" "<<v[i].S,0;
    	}
    }
    rtime();
    return 0;
}

///***Bismillahir Rahmanir Rahim***///
///*********************************///
///******Ashraful Haque Toni********///
///********Dept. of CSE,JnU*********///
///email:ashrafulhaquetoni@gmail.com///
///*******contact:01640690531*******///
///*********************************///

#include<bits/stdc++.h>

using namespace std;

#define         ash               ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define         pb                push_back
#define         mp                make_pair
#define         I1(n)             cin>>n
#define         I2(m,n)           cin>>m>>n;
#define         sc(n)             scanf("%d",&n);
#define         scl(n)            scanf("%I64d",&n);
#define         sc2(m,n)          scanf("%d%d",&m,&n);
#define         sc2l(m,n)         scanf("%I64d%I64d",&m,&n);
#define         pf                printf
#define         f(i,n)            for(ll i=0;i<(n);i++)
#define         f1(i,n)           for(ll i=1;i<=(n);i++)
#define         ar_input(a,n)     f(i,n)cin>>a[i];
#define         ve_input(v,n)     f(i,n){ll m;cin>>m,v.pb(m);}
#define         Max               INT_MAX
#define         Min               INT_MIN
#define         pi                acos(-1.0)
#define         Mem(a,val)        memset(a,val,sizeof(a));
#define         asort(a,n)        sort(a,a+n)
#define         vsort(v)          sort(v.begin(),v.end())
#define         fr(i,s,e)         for(ll i=s;i<=e;i++)
#define         ff                first
#define         ss                second
#define         vec               vector<ll>
#define         pai               pair<ll,ll>
#define         Map               map<ll,ll>
#define         mod               1000000007
#define         ll                long long

                                       ///template function///

/// ll GCD(ll a,ll b){if(a<0) a*=-1;if(b<0) b*=-1;if(a<b)swap(a,b);if(b==1) return 1;if(!b) return a;if(!(a%b)) return b;else return GCD(b,a%b);}
/// ll LCM(ll a,ll b){ll x=GCD(a,b);return (a/x)*b;}
/// ll bigmod(ll n,ll p){if(p==0) return 1;if(p==1)return (n+mod)%mod;if(p%2)return (bigmod(n,p-1)*n+mod)%mod;else{ll x=bigmod(n,p/2);return (x*x+mod)%mod;}}
/// ll modinverse(ll n){return bigmod(n,mod-2)%mod;}
/// vec de;void devisors(ll n){ll i;for(i=1;i<=sqrt(n);i++){if(!(n%i) && i!=sqrt(n)){de.pb(i);de.pb(n%i);}}if((i-1)*(i-1)==n) de.pb(i-1);vsort(v);}

///*********************************************start***********************************************///

int main()
{

    ash;

    pai p[55],p1[55];

    int n,m;
    I1(n);

    m=n*4+1;

    f(i,m)
    {
        cin>>p[i].ff>>p[i].ss;
        p1[i].ss=p[i].ff;
        p1[i].ff=p[i].ss;
    }

    asort(p,m);
    asort(p1,m);

//    f(i,m)
//    {
//        cout<<p[i].ff<<" "<<p[i].ss<<" ";
//        cout<<p[i].ff<<" "<<p[i].ss<<endl;
//    }

    if(p[0].ff!=p[1].ff)
    {
        cout<<p[0].ff<<" "<<p[0].ss<<endl;
        exit(0);
    }

    if(p[m-1].ff!=p[m-2].ff)
    {
        cout<<p[m-1].ff<<" "<<p[m-1].ss<<endl;
        exit(0);
    }

    if(p1[0].ff!=p1[1].ff)
    {
        cout<<p1[0].ss<<" "<<p1[0].ff<<endl;
        exit(0);
    }

    if(p1[m-1].ff!=p1[m-2].ff)
    {
        cout<<p1[m-1].ss<<" "<<p1[m-1].ff<<endl;
        exit(0);
    }

    int x=p[0].ff,y=p[m-1].ff,xx=p1[0].ff,yy=p1[m-1].ff;
    //cout<<x<<y<<xx<<yy<<endl;

    f(i,m)
    {
        if(x!=p[i].ff && y!=p[i].ff && xx!=p[i].ff && yy!=p[i].ff &&x!=p[i].ss && y!=p[i].ss && xx!=p[i].ss && yy!=p[i].ss)
        {
            cout<<p[i].ff<<" "<<p[i].ss<<endl;
            //cout<<p[i].ff<<" "<<x<<endl;
            exit(0);
        }
    }

    return 0;
}

///**********************************************end*************************************************///

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

using pll = pair<ll, ll>;
using vll = vector<ll>;
using vpll = vector<pll>;
using gr = vector<vll>;
using wgr = vector<vpll>;

#define pb push_back
#define FOR(i, m, n) for (ll i(m); i < n; i++)
#define REP(i, n) FOR(i, 0, n)
#define F(n) REP(i, n)
#define FF(n) REP(j, n)
struct d_ {
    template<typename T> d_ & operator ,(const T & x) { cerr << ' ' <<  x; return *this;}
    template<typename T> d_ & operator ,(const vector<T> & x) { for(auto x: x) cerr << ' ' <<  x; return *this;}
} d_t;
#define dbg(args ...) { d_t,"|",__LINE__,"|",":",args,"\n"; }
#define EPS (1e-10)
#define INF (1LL<<61)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define all(x) begin(x),end(x)
#define IN(n) ll n;cin >> n;
#define x first
#define y second

int main(void) {
    ios_base::sync_with_stdio(false);
    ll n; cin >> n;
    ll N = 4*n+1;
    vll x(N),y(N);
    map<ll,ll> cntx;
    map<ll,ll> cnty;
    F(N) {
        cin >> x[i] >> y[i];
        cntx[x[i]]++;
        cnty[y[i]]++;
    }
    vll xx,yy;
    for(auto &i: cntx) if(i.y>1) xx.pb(i.x);
    for(auto &i: cnty) if(i.y>1) yy.pb(i.x);
    ll xmi = *min_element(all(xx));
    ll xma = *max_element(all(xx));
    ll ymi = *min_element(all(yy));
    ll yma = *max_element(all(yy));
    F(N) {
        ll a=x[i],b=y[i];
        if((a!=xmi && a!= xma) && (b!=ymi && b!=yma)) { // inside
            cout << a << ' ' << b << endl;
            return 0;
        }
        if((a<xmi || a>xma) || (b<ymi || b>yma)) { // outside
            cout << a << ' ' << b << endl;
            return 0;
        }
    }
    return 0;
}

/*"Everything in the universe is balanced. Every disappointment
   you face in life will be balanced by something good for you!
                Keep going, never give up."						*/
#include "bits/stdc++.h"
using namespace std;

#define ll long long int
#define ld double
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define repd(i,a,b) for(int i=a;i>=b;--i)
#define deb cerr << "Line no." << __LINE__
#define nl '\n'
#define pb push_back
#define all(a) a.begin(),a.end()
#define P pair<ll,ll>
#define F first
#define S second
const ll p_mod=9999999999999983;
const long double pi = 3.14159265358979323;
const ll N=1e6+9;
const ll mod=1e9+7;
typedef double f80;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){uniform_int_distribution<int> uid(l, r); return uid(rng); }
ll powerk(ll x, ll y);

ll a[N],n;

bool check(map<P,ll> mp)
{
	ll x,y,p=0,q=0,r=0,s=0,minx=1e10, miny=1e10, maxx=0, maxy=0;
	for(auto it:mp)
	if(it.S)
	{
		//if(!mp[{0,3}])
		//cout<<it.F.F<<" "<<it.F.S<<nl;
		x= it.F.F;
		y=it.F.S;
		minx = min(minx, x);
		miny = min(miny, y);
		maxx = max(maxx, x);
		maxy = max(maxy, y);

	}

	rep(i,minx, maxx)
	{
		if(mp[{i,miny}])
		{mp[{i,miny}]--,p++;
			if(i==maxx)s++;
			if(i==minx)r++;}
		//else return 0;
		if(mp[{i,maxy}])
		{mp[{i,maxy}]--,q++;
			if(i==minx)r++;
			if(i==maxx)s++;}
		//else return 0;
	}

	rep(i,miny+1,maxy-1)
	{
		if(mp[{minx,i}])
		mp[{minx,i}]--,r++;
		//else return 0;
		if(mp[{maxx,i}])
		mp[{maxx,i}]--,s++;
		//else return 0;
	}
	/*if(!mp[{10,45}])
	{
	cout<<minx<<" "<<maxx<<nl;
		for(auto it: mp)
		{
			cout<<it.F.F<<" "<<it.F.S<<" "<<it.S<<nl;
		}
	}*/
	//cout<<p<<" "<<q<<" "<<r<<" "<<s<<nl;
	for(auto it: mp)if(it.S)return 0;
	if(p<n || q<n || r<n || s<n)return 0;
	return 1;
}

void solve()
{
	ll m,x,y;
	cin>>n;
	map<P,ll> mp;
	rep(i,1,4*n+1)
	{
		cin>>x>>y;
		mp[{x,y}]++;
	}
	for(auto it:mp)
	{
		//cout<<mp.size()<<nl;
		mp[it.F]--;
		x=check(mp);
		//if(!mp[{0,3}])
		//cout<<x;
		if(x)
		{
			cout<<it.F.F<<" "<<it.F.S;
			return ;
		}
		mp[it.F]++;
		//cout<<it.F.F<<" "<<it.F.S<<nl;
	}
	/*cout<<miny<<" "<<maxy<<nl;

	rep(i,minx, maxx)
	{
		mp[{i,miny}]--;
		mp[{i,maxy}]--;
	}
	rep(i,miny+1,maxy-1)
	{
		mp[{minx,i}]--;
		mp[{miny,i}]--;
	}
	for(auto it: mp)
	{
		if(it.S)
		{
			cout<<it.F.F<<" "<<it.F.S;
			return ;
		}

	}
*/
}

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll t=1;
    //pre();
    //cin>>t;
    while(t--)
    {
      solve();
    }
}
ll powerk(ll x, ll y)
{
  if(y==0)return 1;
  if(y==1)return x%mod;
  if(y&1)
    return ((powerk((x*x)%mod, y/2)%mod)*x)%mod;
  else return powerk((x*x)%mod,y/2)%mod;
}

// Xorawar

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ll long long
#define db double
#define el "\n"
#define ld long double
#define rep(i,n) for(long long i=0;i<n;i++)
#define rev(i,n) for(long long i=n;i>=0;i--)
#define rep_a(i,a,n) for(long long i=a;i<n;i++)
#define tr(ds, it) for(auto it=ds.begin(); it!=ds.end(); it++)
#define rtr(ds, it) for(auto it=ds.rbegin(); it!=ds.rend(); it--)
#define all(ds) ds.begin(), ds.end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
typedef priority_queue <int> pq;
typedef vector< long long > vi;
typedef pair<long long, long long> ii;
#define o_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define graph vector<vi>

const ll MAX = 51;
const ll mod = 1000000007;
ll po(ll x, ll n ){
	ll ans=1;
     while(n>0){
     	if(n&1) ans=(ans*x)%mod;
     	x=(x*x)%mod;
     	n/=2;
     }
     return ans;
}

vi freq_x(MAX,0);
vi freq_y(MAX,0);

bool isSatisfied(vector<ii> coords,ll x,ll y){
	ll n=coords.size();

	ll xc=0,yc=0;

	rep(i,n){
		if(coords[i].ff == x && coords[i].ss == y) continue;
		xc=max(xc,coords[i].ff);
		yc=max(yc,coords[i].ss);
	}

	if(xc != yc) return false;

	if((x==0 || x==xc) && y<=xc) return false;
	if((y==0 || y== xc) && x<=xc) return false;

	return true;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r" , stdin);
	//freopen("output.txt", "w" , stdout);
	#endif

	ll t;
	t=1;
	//cin >> t;

	while(t--){
		ll n;
		cin >> n;

		ll sz=4*n+1;

		vector<ii> coords;

		rep(i,sz){
			ll x,y;
			cin >> x >> y;
			coords.pb({x,y});
			freq_x[x]++;
			freq_y[y]++;
		}

		ll lower_x=INT_MAX,lower_y=INT_MAX,upper_x=-1,upper_y=-1;

		rep(i,sz){
			ll xc=coords[i].ff,yc=coords[i].ss;
			if(freq_x[xc] >= n) {
				upper_x=max(upper_x,xc);
				lower_x=min(lower_x,xc);
			}
			if(freq_y[yc] >= n){
				upper_y=max(upper_y,yc);
				lower_y=min(lower_y,yc);
			}
		}

		ll x=-1,y=-1;

		//cout << lower_x << el << upper_x << el << lower_y << el << upper_y << el;

		rep(i,sz){
			ll xc=coords[i].ff,yc=coords[i].ss;
			if((xc==lower_x) && (yc>=lower_y && yc<=upper_y)) continue;
			if((xc==upper_x) && (yc>=lower_y && yc<=upper_y)) continue;
			if((yc==lower_y) && (xc>=lower_x && xc<=upper_x)) continue;
			if((yc==upper_y) && (xc>=lower_x && xc<=upper_x)) continue;
			x=xc,y=yc;
			break;
		}

		cout << x << " " << y << el;

	}

	cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<long long, null_type,less<long long>, rb_tree_tag,tree_order_statistics_node_update>
//s.find_by_order(index) returns iterator to the index-th element
//in O(logn) time.

typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vii;
typedef vector<string> vss;
typedef vector<pair<ll, ll> > vpll;
typedef unordered_map<ll ,ll> mpll;
typedef unordered_map<int ,int> mpii;
typedef unordered_map<char ,ll> mpcl;
typedef pair<ll , ll> pll;
typedef complex<double> cd;
typedef vector< complex<double> > vcd;

#define fore(i,n) for(i=0;i<n;i++)
#define forz(i,s,f) for(i=s;i<f;i++)
#define forer(i,n) for(i=n-1;i>=0;i--)
#define forzr(i,s,f) for(i=s;i>=f;i--)
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define ub upper_bound
#define lb lower_bound
#define ff first
#define ss second
#define pvec(i,vec) fore(i,vec.size())cout<<vec[i]<<" ";cout<<"\n";

const ll mod=1e9+7;
const ll modulo=998244353;
const double pi = 3.14159265358979323846;

ll power(ll x,ll y,ll m)//gives (x^y)%m
{
    ll ans=1;
    while (y>0)
    {
        if(y & 1)
        {
            ans=(ans*x)%m;
        }
        y=y/2;
        x=(x*x)%m;
    }
    return ans;
}

ll gcd(ll a,ll b)
{
	if(a==0)
		return b;
	else
		return(gcd(b%a,a));
}

ll lcm(ll a,ll b)
{
	ll ans=(a*b)/gcd(a,b);
	return ans;
}

long double logn(long double a,long double n)
{
	return(log(n)/log(a));
}

bool sortbysec(pll &a,pll &b)
{
    return(a.ss<b.ss);
}

int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);

	ll te=1,test,i,j,n,m,flag,k,f,p,s,t,temp,x1,x2,y1,y2;
	//cin>>te;

	for(test=1;test<=te;test++)
	{
		cin>>n;

		vpll a(4*n+1);
		fore(i,4*n+1)
		{
			cin>>a[i].ff>>a[i].ss;
		}

		k=4*n+1;
		fore(i,k)
		{
			x1=100;y1=100;x2=-1;y2=-1;
			fore(j,k)
			{
				if(i==j)
					continue;

				x1=min(x1,a[j].ff);
				x2=max(x2,a[j].ff);
				y1=min(y1,a[j].ss);
				y2=max(y2,a[j].ss);
			}

			flag=0;
			fore(j,k)
			{
				if(i==j)
					continue;

				/*if(x1==a[j].ff && y1==a[j].ss)
					p++;
				else if(x1==a[j].ff && y2==a[j].ss)
					p++;
				else if(x2==a[j].ff && y1==a[j].ss)
					p++;
				else if(x2==a[j].ff && y2==a[j].ss)
					p++;
				else
				{*/
					if((x1<a[j].ff && a[j].ff<x2 && y1<a[j].ss && a[j].ss<y2) || (a[j].ff<x1 || x2<a[j].ff || a[j].ss<y1 || y2<a[j].ss))
					{
						flag=1;
						break;
					}
			}

			if(flag==0)
			{
				f=0;p=0;s=0;t=0;
				fore(j,k)
				{
					if(i==j)
						continue;

					if(a[j].ff==x1)
						f++;
					if(a[j].ff==x2)
						p++;
					if(a[j].ss==y1)
						s++;
					if(a[j].ss==y2)
						t++;
				}

				if(f>=n && p>=n && s>=n && t>=n)
					break;
			}
		}

		cout<<a[i].ff<<" "<<a[i].ss<<"\n";
		//cout<<"hello\n";
		//cout<<"Case #"<<test<<": ";
	}

	return 0;
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
using namespace std;
typedef unsigned long long ULL;
typedef long long LL;
const LL maxn = 60;

int arr[maxn][maxn] = {0};

int main() {
    int n,x,y;cin>>n;
    for(int i = 0; i < 4*n+1; i++) {cin >> x >> y;arr[x][y] =1;}

    int u,d,l,r, cnt1 = 0, cnt2 = 0;
    for(int i = 0; i <= 50; i++) {
        int c1 = 0, c2 = 0;
        for(int j = 0; j <= 50; j++){
            if(arr[i][j]) c1++;
            if(arr[j][i]) c2++;
        }
        if(c1 >= n)
            if(!cnt1) {u = i;cnt1++;}
            else d = i;
        if(c2 >= n)
            if(!cnt2) {l = i;cnt2++;}
            else r = i;
    }
    for(int i:{u,d})
        for(int j = l; j <= r; j++)
            arr[i][j] = 0;
    for(int i:{l,r})
        for(int j = u; j <= d; j++)
            arr[j][i] = 0;
    for(int i = 0; i < 51; i++)
        for(int j = 0; j < 51; j++)
            if(arr[i][j]) {
                printf("%d %d\n",i,j);
                return 0;
            }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> piii;
typedef pair<int,ll> pil;
typedef pair<ll,ll> pll;
typedef tuple<ll,ll,ll> plll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vii;
typedef vector<pil> vil;
typedef vector<pll> vll;
typedef vector<piii> viii;
typedef int (*uniopi) (int);
typedef ll (*uniopl) (ll);
typedef int (*binopi) (int, int);
typedef ll (*binopl) (ll, ll);
typedef int (*tupopi) (int, int, int);
typedef ll (*tupopl) (ll, ll, ll);

const ld PI = acos(0)*2;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll*INF*INF;
int X4[] = {-1, 0, 1, 0}, Y4[] = {0, -1, 0, 1};
int X8[] = {-1, -1, -1, 0, 1, 1, 1, 0}, Y8[] = {-1, 0, 1, 1, 1, 0, -1, -1};

#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SZ(x) ((int) (x).size())
#define NTH(v, x) ((int) (lower_bound(ALL(v), (x)) - (v).begin()))
#define SAME(v, x) ((int) (upper_bound(ALL(v), (x)) - lower_bound(ALL(v), (x))))
#define UNIQUE(v) v.erase(unique(ALL(v)), (v).end())

#define pb push_back
#define eb emplace_back
#define INP(t, x) t x; cin >> x

#define CPPIO ios::sync_with_stdio(0); cin.tie(nullptr); cout << std::setprecision(10); cout << fixed

#define forn(x, n) for (int x=0; x<(n); x++)
#define for1(x, n) for (int x=1; x<=(n); x++)
#define ford(x, n) for (int x=(n)-1; x>=0; x--)
#define ford1(x, n) for (int x=(n); x>=1; x--)
#define forr(x, n, m) for (int x=(n); x<(m); x++)
#define forrd(x, n, m) for (int x=(m)-1; x>(n)-1; x--)

template<typename T> inline bool uax(T &a, T b) { return a<b? (a=b, 1) : 0; }
template<typename T> inline bool uin(T &a, T b) { return a>b? (a=b, 1) : 0; }
template<typename T1, typename T2> istream& operator>>(istream& is, pair<T1,T2>& p) {
	return is >> p.first >> p.second;
}
template<typename T1, typename T2> ostream& operator<<(ostream& os, const pair<T1,T2>& p) {
	return os << '(' << p.first << ", " << p.second << ")";
}
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	for (int i=0; i<(int)v.size(); i++) { os << v[i]; if (i+1<(int)v.size()) os << ' '; } return os;
}

bool square(vii &v) {
	vi a, b;
	for (auto &p : v) a.pb(p.first), b.pb(p.second);
	int xs = *min_element(ALL(a)), xf = *max_element(ALL(a));
	int ys = *min_element(ALL(b)), yf = *max_element(ALL(b));
	if (xf - xs != yf - ys) return 0;
	for (auto &p : v) {
		int x, y; tie(x, y) = p;
		if (x >= xs && x <= xf && (y == ys || y == yf)) continue;
		else if (y >= ys && y <= yf && (x == xs || x == xf)) continue;
		else return 0;
	}
	return 1;
}

int main() {
	CPPIO;

	vii v;
	INP(int, n);
	forn(i, 4*n+1) {
		int a, b; cin >> a >> b; v.eb(a, b);
	}
	forn(i, 4*n+1) {
		vii w;
		forn(j, 4*n+1) { if (i!=j) w.pb(v[j]); }
		if (square(w)) {
			cout << v[i].first << ' ' << v[i].second << endl;
			return 0;
		}
		w.clear();
	}

#ifdef LOCAL_DEFINE
	cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
#endif
	return 0;
}

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

int main()
{
	//freopen("input.txt","r",stdin);
	int n,i,X[52],Y[52],a,b,ind1x,ind2x;
	cin>>n;
	vector<pair<int,int>> vt;
	for(auto &i:X)i=0;
	for(auto &i:Y)i=0;
	for(i=0;i<=4*n;i++)
	{
		cin>>a>>b;
		//cout<<a<<b<<endl;
		//cout<<X[a]<<endl;
		X[a]++;
		Y[b]++;
		vt.push_back({a,b});
		//cout<<X[a]<<endl;
	}
//	cout<<"\n\n\n\n\n";
//	for(auto i: X)cout<<i<<" ";
//	cout<<"\n\n\n\n\n";

	vector <int>vx,vy;
	for(i=0;i<51;i++)
	{
		if(X[i]>=n)
		{
			vx.emplace_back(i);
		}
	}
	vx[1]=vx[vx.size()-1];
	for(i=0;i<51;i++)
	{
		if(Y[i]>=n)
		{
			vy.emplace_back(i);
		}
	}
	vy[1]=vy[vy.size()-1];
//	cout<<vx[0]<<" "<<vx[1]<<endl;
//	cout<<vy[0]<<" "<<vy[1]<<endl;

	for(i=0;i<=4*n;i++)
	{
		if(vt[i].first==vx[0] || vt[i].first==vx[1])
		{
			if(vt[i].second<vy[0] ||  vt[i].second>vy[1])
			{
				cout<<vt[i].first<<" "<<vt[i].second;
				return 0;
			}
		}
		else if(vt[i].second==vy[0] || vt[i].second==vy[1])
		{
			if(vt[i].first<vx[0] ||  vt[i].first>vx[1])
			{
				cout<<vt[i].first<<" "<<vt[i].second;
				return 0;
			}
		}
		else
		{
			cout<<vt[i].first<<" "<<vt[i].second;
			return 0;
		}
	}
}

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,i;
set<int> setx,sety;
cin>>n;
int x[4*n+1],y[4*n+1];
for(i=1;i<=4*n+1;i++){
	cin>>x[i]>>y[i];
	setx.insert(x[i]);
	sety.insert(y[i]);
}
set<int>::iterator it;
vector<int> ux,uy;

for(it=sety.begin();it!=sety.end();it++){
if(count(y+1,y+(4*n+2),*it)>=2)
{
uy.push_back(*it);
}}
for(it=setx.begin();it!=setx.end();it++){
if(count(x+1,x+(4*n+2),*it)>=2)
{
ux.push_back(*it);
}}
ux[1]=*max_element(ux.begin(),ux.end());

uy[1]=*max_element(uy.begin(),uy.end());
int ansx,ansy;
for(i=1;i<=4*n+1;i++){
	if(x[i]<ux[0] and y[i]==uy[0])
	{ansx=x[i];ansy=y[i];break;}
	if(y[i]<uy[0] and x[i]==ux[0])
	{ansx=x[i];ansy=y[i];break;}
		if(y[i]<uy[0] and x[i]==ux[1])
	{ansx=x[i];ansy=y[i];break;}
		if(x[i]>ux[1] and y[i]==uy[0])
	{ansx=x[i];ansy=y[i];break;}
		if(x[i]>ux[1] and y[i]==uy[1])
	{ansx=x[i];ansy=y[i];break;}
		if(y[i]>uy[1] and x[i]==ux[1])
	{ansx=x[i];ansy=y[i];break;}
		if(y[i]>uy[1] and x[i]==ux[0])
	{ansx=x[i];ansy=y[i];break;}
		if(x[i]<ux[0] and y[i]==uy[1])
	{ansx=x[i];ansy=y[i];break;}
		if(x[i]!=ux[0] and x[i]!=ux[1] and y[i]!=uy[0] and y[i]!=uy[1])
	{ansx=x[i];ansy=y[i];break;}
}

cout<<ansx<<" "<<ansy<<"\n";

return 0;
}

#include <bits/stdc++.h>

typedef long long ll;
const ll MOD = 1000000007;

using namespace std;

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    vector<pair<int, int> > pts;
    cin >> n;
    for (int i = 0; i < 4 * n + 1; i++) {
        int x, y;
        cin >> x >> y;
        pts.push_back({x, y});
    }
    sort(pts.begin(), pts.end());
    int lx = pts[1].first;
    int rx = pts[4 * n - 1].first;
    sort(pts.begin(), pts.end(), comp);
    int uy = pts[4 * n - 1].second;
    int by = pts[1].second;
    for (int i = 0; i < 4 * n + 1; i++) {
        int x = pts[i].first;
        int y = pts[i].second;
        if ((x == lx && y <= uy && y >= by) || (x == rx && y <= uy && y >= by) || (y == uy && x >= lx && x <= rx) || (y == by && x >= lx && x <= rx)) {
            continue;
        } else {
            cout << x << " " << y;
            return 0;
        }
    }
    return 0;
}

#include <bits/stdc++.h>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MAX 2000005
#define MOD 1000000007
#define MOD2 998244353
#define pb push_back
#define mp make_pair
#define pii pair<ll,ll>
#define vi vector<ll>
#define vp vector<pii>
#define all(v) v.begin(),v.end()
#define sz(x) (ll)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(ll i=a;i<b;++i)
#define ROF(i,a,b) for(ll i=a;i>=b;--i)
#define trace(x) cerr<<#x<<": "<<x<<'\n';
typedef long long ll;
using namespace std;
//using namespace __gnu_pbds;
//#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

ll mexp(ll a, ll b){
    ll ans=1;
    a%=MOD;
    while(b){
        if(b&1) ans=ans*a%MOD;
        b>>=1;
        a=a*a%MOD;
    }
    return ans;
}

int n,m;
int lx,ly;
bool ck;
vector<pair<int,int>>inp;
vector<int> vx,vy;
map<int,int> cntx,cnty;

void get(ll xa, ll xb, ll ya, ll yb){
    int c=0;
    int ansx,ansy;
    FOR(i,0,m){
        if(inp[i].F==xa || inp[i].F== xb){
            if(inp[i].S<ya ||  inp[i].S>yb){
                c++;
                ansx=inp[i].F;
                ansy= inp[i].S;
            }
        }
        if(inp[i].S == ya || inp[i].S== yb){
            if(inp[i].F < xa ||  inp[i].F> xb){
                c++;
                ansx=inp[i].F;
                ansy= inp[i].S;
            }

        }
        if(inp[i].F!=xa && inp[i].S!=ya && inp[i].F!=xb && inp[i].S!=yb){
            c++;
            ansx=inp[i].F;
            ansy= inp[i].S;
        }

    }
    if(c==1){
        ck=1;
        cout<<ansx<<" "<<ansy;
    }
}

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

    int n;
    cin>>n;
    m=4*n+1;
    FOR(i,0,m){
        int x,y;
        cin>>x>>y;
        cntx[x]++;
        cnty[y]++;
        inp.pb({x, y});
    }
    lx=sz(cntx);
    ly=sz(cnty);
    for(auto i:cntx){
        vx.pb(i.F);
    }
    for(auto i:cnty){
        vy.pb(i.F);
    }
    ll cnt=0;
    FOR(i,0,lx){
        FOR(j,i+1,lx){
            FOR(k,0,ly){
                FOR(l,k+1,ly){
                    if(vx[j]-vx[i]==vy[l]-vy[k] ){
                        get(vx[i],vx[j],vy[k],vy[l]);
                        cnt++;
                        if(ck){
                            break;
                        }
                    }
                }
                if(ck){
                    break;
                }
            }
            if(ck){
                break;
            }
        }
        if(ck){
            break;
        }
    }
    cerr<<"Time: "<<1.0/CLOCKS_PER_SEC<<" ms"<<endl;
    return 0;
}

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

bool ara[1000][1000];
//map<int,int>mp;
int xt[1000];
int yt[1000];
bool ss()
{
    for(int i=0;i<51;i++)
    {
        for(int j=0;j<51;j++)
        {
            if(ara[i][j]==1)
            {
//                cout<<i<<"  "<<j<<"   "<<mp[i]<<" "<<mp[j]<<endl;
                if(xt[i]<2&&yt[j]<2)
                {
                    cout<<i<<" "<<j<<endl;
                    return 1;
                }
            }
        }
    }
    return 0;
}
bool check(int x,int y)
{
    bool f=0;
    int cnt=0;
//    cout<<"check"<<endl;
    for(int j=y;j<51;j++)
    {
        if(ara[x][j]==1)
        {
//            cout<<x<<" "<<j<<endl;
            cnt++;
        }
    }
    if(cnt<2)return 0;
    cnt=0;
//    cout<<"y ok"<<endl;
    for(int i=x;i<51;i++)
    {
        if(ara[i][y]==1){
//            cout<<i<<" "<<y;
            cnt++;
        }
    }
    if(cnt<2)
    return false;
    return true;
//    cout<<"x not ok"<<endl;
}
int main()
{
    int n;cin>>n;
    int mxx=-9,mxy=-9;
    int mnx=100,mny=100;
    for(int i=0;i<4*n+1;i++)
    {
        int a,b;cin>>a>>b;
        xt[a]++;
        yt[b]++;
        ara[a][b]=1;
        mnx=min(mnx,a),mny=min(mny,b),mxx=max(mxx,a),mxy=max(mxy,b);
    }
    if(ss()==1)return 0;
    int dif=min(mxx-mnx,mxy-mny);
//    cout<<mxx<<"  "<<mxy<<"     "<<mnx<<" "<<mny<<endl;
//    cout<<dif<<endl;
    int x=mnx,y=mny;
    if(mxx-mnx!=mxy-mny)
    {
        if(check(mnx,mny)==0){
            x=mxx-dif,y=mxy-dif;
        }
    }
//    cout<<"min = "<<x<<"  "<<y<<endl;
    int xx,yy;
    for(int i=0;i<51;i++)
    {
        for(int j=0;j<51;j++)
        {
            if(ara[i][j]==1)
            {
                if(i==x||i==x+dif)
                {
                    if(j<y||j>y+dif)
                    {
                        xx=i,yy=j;
                        break;
                    }
                }
                else if(j==y||j==y+dif)
                {
                    if(i<x||i>x+dif)
                    {
                        xx=i,yy=j;
                        break;
                    }
                }
                else {
                    xx=i,yy=j;
                    break;
                }
            }
        }
    }
    cout<<xx<<" "<<yy<<endl;
}
/*
2
2 0
3 0
1 1
1 2
0 0
1 0
2 2
3 2
3 1
*/

#include <bits/stdc++.h>
using namespace std;
int x[45],y[45];
int main(){
	int n; cin>>n;
	n = 4*n+1;
	for(int i=1;i<=n;++i){
		cin>>x[i]>>y[i];
	}

	for(int j=1;j<=n;++j){
		int min_x = 105, max_x = -105;
		int min_y = 105, max_y = -105;
		for(int i=1;i<=n;++i) if(i!=j){
			min_x = min(min_x,x[i]);
			max_x = max(max_x,x[i]);

			min_y = min(min_y,y[i]);
			max_y = max(max_y,y[i]);
		}
		if(max_x - min_x != max_y - min_y)
			continue;
		int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
		bool bad = 0;
		for(int i=1;i<=n;++i) if(i!=j){
			if(x[i] == max_x) ++cnt1;
			if(x[i] == min_x) ++cnt2;
			if(y[i] == max_y) ++cnt3;
			if(y[i] == min_y) ++cnt4;
			if(x[i] != max_x && x[i] != min_x
				&& y[i] != max_y && y[i] != min_y)
				bad = 1;
		}

		if(bad || min({cnt1,cnt2,cnt3,cnt4}) < n/4) continue;
		if(x[j] > max_x || x[j] < min_x
			|| y[j] > max_y || y[j] < min_y)
			return cout<<x[j]<<' '<<y[j],0;

		if(x[j] != max_x && x[j] != min_x
			&& y[j] != max_y && y[j] != min_y)
			return cout<<x[j]<<' '<<y[j],0;
	}
}

#include<bits/stdc++.h>
#define pii pair<int,int>
#define F first
#define S second
#define mp make_pair
#define ll long long
using namespace std;
const int N=100;
bool f[N][N],ok;
int n,i,j,add;
void check()
{
	set<pii>st;
	for(int a=i;a<=i+add;a++)
	{
		if(f[a][j])st.insert(mp(a,j));
		if(f[a][j+add])st.insert(mp(a,j+add));
	}
	for(int b=j;b<=j+add;b++)
	{
		if(f[i][b])st.insert(mp(i,b));
		if(f[i+add][b])st.insert(mp(i+add,b));
	}
	if(st.size()!=4*n)ok=false;
	return;
}
void draw()
{
	for(int a=i;a<=i+add;a++)f[a][j]=f[a][j+add]=false;
	for(int b=j;b<=j+add;b++)f[i][b]=f[i+add][b]=false;
}
int main()
{
	cin>>n;
	for(i=0;i<4*n+1;i++)
	{
		int a,b;
		cin>>a>>b;
		f[a][b]=true;
	}
	for(i=0;i+n<=50;i++)
	{
		for(j=0;j+n<=50;j++)
		{
			for(add=0;add<=50;add++)
			{
				ok=true;
				check();
				if(ok)
				{
					draw();
					for(int a=0;a<=50;a++)
					{
						for(int b=0;b<=50;b++)
						{
							if(f[a][b])
							{
								cout<<a<<" "<<b<<endl;
								return 0;
							}
						}
					}
				}
			}
		}
	}
	return 0;
}

/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

/* see https://github.com/pllk/cphb/ */
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
    tree_order_statistics_node_update> indexed_set;

typedef unsigned int uint;
typedef long long ll;
//typedef __int128 lll;

#define fori(n) for(ll i=0; i<(n); i++)

typedef pair<int, int> pii;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;

int main() {
cin.tie(nullptr);
std::ios::sync_with_stdio(false);
    const int N=51;
    int n;
    cin>>n;
    vi x(n*4+1);
    vi y(n*4+1);
    vi fx(N);
    vi fy(N);

    int minx=1000;
    int miny=1000;
    int maxx=-1;
    int maxy=-1;
    fori(4*n+1) {
        cin>>x[i]>>y[i];
        fx[x[i]]++;
        fy[y[i]]++;
    }

    /* upper x is biggest x with more than 1 f */
    for(int i=N-1; i>=0; i--)
        if(fx[i]>=n) {
            maxx=i;
            break;
        }
    for(int i=N-1; i>=0; i--)
        if(fy[i]>=n) {
            maxy=i;
            break;
        }
    for(int i=0; i<N; i++)
        if(fx[i]>=n) {
            minx=i;
            break;
        }
    for(int i=0; i<N; i++)
        if(fy[i]>=n) {
            miny=i;
            break;
        }

    fori(n*4+1) {
        if(((x[i]>=minx && x[i]<=maxx) && (y[i]==miny || y[i]==maxy))
            ||
            ((y[i]>=miny && y[i]<=maxy) && (x[i]==minx || x[i]==maxx)))
            ;
        else {
            cout<<x[i]<<" "<<y[i]<<endl;
            return 0;
        }
    }

}

#include <bits/stdc++.h>

using namespace std;

#define X first
#define Y second

int n;
vector<pair<int,int> > pt;
bool is_ok(int id){
    int min_x = INT_MAX, max_x = 0;
    int min_y = INT_MAX, max_y = 0;
    for(int i = 0; i < n; i++){
        if(i==id) continue;
        min_x = min(min_x,pt[i].X), max_x = max(max_x, pt[i].X);
        min_y = min(min_y,pt[i].Y), max_y = max(max_y, pt[i].Y);
    }
    for(int i = 0; i < n; i++){
        if(id==i) continue;
        pt[i].X-=min_x;
        pt[i].Y-=min_y;
    }
    vector<vector<int> > tab(51,vector<int>(51,0));
    for(int i = 0; i < n; i++){
        if(i==id) continue;
        tab[pt[i].X][pt[i].Y] = 1;
    }
    for(int m = 50; m >= 0; m--){

        int cnt = 0;
        for(int i = 0; i <= m; i++) cnt += tab[i][0];
        for(int i = 1; i <= m; i++) cnt += tab[0][i];
        for(int i = 1; i <= m; i++) cnt += tab[i][m];
        for(int i = 1; i <  m; i++) cnt += tab[m][i];
        if(cnt==n-1) return true;
    }
    for(int i = 0; i < n; i++){
        if(id==i) continue;
        pt[i].X+=min_x;
        pt[i].Y+=min_y;
    }
    return false;
}

int main()
{
    cin >> n;
    n = 4*n+1;
    pt.resize(n);
    for(int i = 0; i < n; i++) cin >> pt[i].X >> pt[i].Y;
    for(int i = 0; i < n; i++){
        bool ok = is_ok(i);
        if(ok) {
            cout << pt[i].X << " " << pt[i].Y << "\n";
            return 0;
        }
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5005, P = 1e9 + 7, M = 55;
typedef pair<int, int> pii;
pii p[M];
//vector <pair<int, int> > v;
vector <int> u[M], v[M];
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < 4 * n + 1; i++){
        cin >> p[i].first >> p[i].second;
        v[p[i].first].push_back(p[i].second);
        u[p[i].second].push_back(p[i].first);
    }
    /*for (int i = 0; i < 51; i++){
        if (v[i].size() > 1)  sort(v[i].begin(), v[i].end());
        if (u[i].size() > 1)  sort(u]i].begin(), u[i].end());
    }*/
    int tl = 51, tr = 0;
    for (int i = 0; i < 51; i++){
        if (v[i].size() == 0)  continue;
        if (v[i].size() == 1){
            cout << i << " " << v[i][0] << "\n";
            return 0;
        }
        if (v[i].size() >= n){
            tl = i;
            break;
        }
    }
    for (int i = 50; i >= 0; i--){
        if (v[i].size() == 0)  continue;
        if (v[i].size() == 1){
            cout << i << " " << v[i][0] << "\n";
            return 0;
        }
        if (v[i].size() >= n){
            tr = i;
            break;
        }
    }
    int sl = 51, sr = 0;
    for (int i = 0; i < 51; i++){
        if (u[i].size() == 0)  continue;
        if (u[i].size() == 1){
            cout << u[i][0] << " " << i << "\n";
            return 0;
        }
        if (u[i].size() >= n){
            sl = i;
            break;
        }
    }

    for (int i = 50; i >= 0; i--){
        if (u[i].size() == 0)  continue;
        if (u[i].size() == 1){
            cout << u[i][0] << " " << i << "\n";
            return 0;
        }
        if (u[i].size() >= n){
            sr = i;
            break;
        }
    }
    for (int i = 0; i < 4 * n + 1; i++){
        if (p[i].first != tl and p[i].first != tr and p[i].second != sl and p[i].second != sr){
            cout << p[i].first << " " << p[i].second << "\n";
            return 0;
        }
    }
    /*for (int i = tl + 1; i < tr; i++){
        if (v[i].size() > 2){
            int ans = v[i][0] > v[i][1] ? (v[i][2] > v[i][0] ? v[i][0] : (v[i][2] > v[i][1] ? v[i][2] : v[i][1]))
                                     : (v[i][1] < v[i][2] ? v[i][1] : (v[i][0] > v[i][2] ? v[i][0] : v[i][2]));
            cout << i << " " << ans << "\n";
            return 0;
        }
    }
    for (int i = sl + 1; i < sr; i++){
        if (u[i].size() > 2){
            int ans = u[i][0] > u[i][1] ? (u[i][2] > u[i][0] ? u[i][0] : (u[i][2] > u[i][1] ? u[i][2] : u[i][1]))
                                     : (u[i][1] < u[i][2] ? u[i][1] : (u[i][0] > u[i][2] ? u[i][0] : u[i][2]));
            cout << ans << " " << i << "\n";
            return 0;
        }
    }*/

    return 0;
}

// Marcin Knapik
// before you read it
// make sure it's a good idea
#include<bits/stdc++.h>
#pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
using namespace std;

typedef long long         ll;
typedef unsigned long long      ull;
typedef pair< ll, ll >        pll;
typedef pair< int, int  >       ii;
typedef vector< int  >       vi;
typedef vector< ii >        vii;
typedef vector< vi >        vvi;
typedef vector< vector < ii > >   vvii;
typedef vector< ll >        vll;
typedef vector< pll >       vpll;
typedef long double         ld;

#define boost   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define szy     first
#define gi      second
#define sz(a)   (int)(a).size()
#define pb      push_back
#define all(c)    (c).begin(), (c).end()
#define rall(c)   (c).rbegin(), (c).rend()
#define REP(i, a, b) for (int i = (a); i <= (b); i++)
#define FOR(i, a) for (int i = 0; i < (a); i++)
#define TRAV(i, n) for(auto&i:n)
#define beg(x) (*(x.begin()))
#define re(x) int x; cin >>x;
#define f first
#define s second

template <class T> inline bool setmin(T &a, T b){if (a > b)return a = b, 1;return 0;}
template <class T> inline bool setmax(T &a, T b){if (a < b)return a = b, 1;return 0;}

template<class T> inline T fast(T a,T b,T mod) {ll res = 1; while(b){if(b&1) res = (res*a)%mod;a = (a*a)%mod;b >>= 1;}return res;}
template<class T> inline T russian(T a, T b, T mod) {ll res = 0; while(b){if(b&1) res = (res + a)%mod; a = (a+a)%mod; b>>=1;}return res;}
template<class T> inline T sub(T a, T b, T mod) {return ((a%mod - b%mod)+mod)%mod;}
template<class T> inline T mult(T a, T b, T mod) {return ((a%mod * b%mod)+mod)%mod;}
template <class T> istream &operator>>(istream &os, vector<T> &container){for (auto &u : container)os >> u;return os;}
template <class T> ostream &operator<<(ostream &os, const vector<T> &container){for (auto &u : container)os << u << " ";return os;}
template<typename T> inline T gcd(T a, T b) { while (b)swap(a %= b, b); return a; }

ld e = 2.7182818284590452353602874713526624;
ld PI = acos(-1);
ld eps = 1e-11;

const ll T = 1 << 14;
const ll INF = 1e9 + 7;
const ll MOD = 998244353;
const ll BIG_INF = 1e18 + 7;
const long long  N = 1e6 + 7;
const ll M = 2007;

ll n, m, k;
string w;

int X[51];
int Y[51];

vii punkty;

signed main(){
	boost;

	cin >> n;
	FOR(i,4*n+1){
		re(a) re(b)
		punkty.pb({a,b});
	}

	REP(a, 0, 50)
		REP(b, a+1, 50)
			REP(c, 0, 50)
			 	{
			 		int d = c + (b-a);
			 		int ile = 0;
			 		ii not_on;
			 		TRAV(u, punkty){
			 			if( ((u.f == a || u.f == b) && (u.s >= c && u.s <= d)) || ((u.f >= a && u.f <= b) && (u.s == c || u.s == d)))
			 				ile++;
			 			else
			 				not_on = u;
			 		}
			 		// cout << a << ' ' << b << ' ' <<  c <<  ' ' << d << ' ' << ile << '\n';
			 		if(ile == n*4){
			 			cout << not_on.f << ' ' << not_on.s << '\n';
			 			exit(0);
			 		}
			 	}
}

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble
#define PI 3 .14159265

//typedef tuple <int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

#define siz(x) (int)(x).size()
#define Y second
#define X first
#define IN insert
#define PB push_back
#define P pop_back
#define PU push
#define PO pop
//#define F find
#define ED end()
#define MP( a, b) make_pair( a, b )

#define MOD 1000000007LL
#define INF 1000000000
#define rep(a,i,b) for (ll i = (a); i < (b); ++i)
#define reps(a,i,b) for (ll i = (a); i <= (b); ++i)
#define repd( num, i, ed ) for(ll (i)= (num)-1; (i) >= e38d; --(i))
#define repkt( bg, i, num, kt ) for(ll (i)= (bg); (i) < (num) && (kt); ++(i))
#define repchar( i ) for(char (i)= 48; (i) <= 122; (i)++)
#define in(n) scanf("%lld", &n)
#define out(n) printf("%lld\n", n)
#define outS(s) printf("%s\n", s)
#define setA(a,n) for(ll i= 0, j= sizeof(a)/sizeof(a[0]); i < j; ++i) a[i]= n;
#define repe(num,i,ed) for(ll (i)= (num); (i) >= ed; --(i))
#define endl "\n"
const int N=55;
int x[N],y[N];
int n;
int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
    // freopen("input.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
    cin>>n;
    for(int i=1;i<=4*n+1;++i) cin>>x[i]>>y[i];
    for(int i=1;i<=4*n+1;++i)
    {
        int maxx=0,minx=50,maxy=0,miny=50;
        for(int j=1;j<=4*n+1;++j)
        {
            if(i!=j)
            {
                maxx=max(maxx,x[j]);
                minx=min(minx,x[j]);
                maxy=max(maxy,y[j]);
                miny=min(miny,y[j]);
            }
            bool check=1;
            for(int j=1;j<=4*n+1;++j)
            {
                if(i!=j)
                {
                    if(x[j]!=maxx&&x[j]!=minx&&y[j]!=maxy&&y[j]!=miny) check=0;
                }
            }
            if(check&&maxx-minx==maxy-miny) return cout<<x[i]<<" "<<y[i],0;
        }
    }
    cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms\n";
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,sum;
struct dian{
	int x,y;
};
struct dian b[50];
int t1[51]={0},t2[51]={0};
int a1=0,a2=0;
int mmax1,mmin1,mmax2,mmin2;
int main(){
cin>>n;
sum=4*n+1;
for(int i=1;i<=sum;i++){
	scanf("%d %d",&b[i].x,&b[i].y);
	t1[b[i].x]++;t2[b[i].y]++;
	if(b[i].x>50||b[i].x<0||b[i].x>50||b[i].y<0){
		printf("%d %d",b[i].x,b[i].y);
		return 0;
	}
}
for(int i=0;;i++){
	if(t1[i]>=n){
	mmin1=i;

	break;}

}
if(!a1)for(int i=50;;i--){
	if(t1[i]>=n){
	mmax1=i;

	break;}

}

for(int i=50;;i--){
	if(t2[i]>=n){
	mmax2=i;

	break;}

}
for(int i=0;;i++){

	if(t2[i]>=n){

	mmin2=i;

	break;}

}
for(int i=1;i<=sum;i++){
	if(b[i].x<mmin1||b[i].x>mmax1||b[i].y<mmin2||b[i].y>mmax2){
		printf("%d %d",b[i].x,b[i].y);
		return 0;
	}
	else if(b[i].x!=mmin1&&b[i].x!=mmax1&&b[i].y!=mmin2&&b[i].y!=mmax2){
		printf("%d %d",b[i].x,b[i].y);
		return 0;
	}
}

return 0;
}

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

class Point
{
public:
    int x,y;

    double dist(Point P)
    {
        double d = sqrt(((P.x - x) * (P.x - x)) + ((P.y - y) * (P.y - y)));
        return d;
    }
};

bool chk(Point P1,Point P2,Point P3)
{
    double d1 = P1.dist(P3);
    double d2 = P2.dist(P3);
    double d = P1.dist(P2);

    if(d == d1 + d2)
        return true;
    return false;
}

signed main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int n,i,min_x,max_x,min_y,max_y;
    cin>>n;

    Point pt[4*n + 1];
    min_x=min_y=200;
    max_x=max_y=-200;
    map<int,int> cnt_x,cnt_y;
    for(int i=0;i<4*n+1;i++)
    {
        cin>>pt[i].x>>pt[i].y;
        cnt_x[pt[i].x]++;
        cnt_y[pt[i].y]++;
        min_x=min(min_x,pt[i].x);
        max_x=max(max_x,pt[i].x);
        min_y=min(min_y,pt[i].y);
        max_y=max(max_y,pt[i].y);
    }

    // cout<<min_x<<' '<<min_y<<endl;
    // cout<<max_y<<' '<<max_y<<endl;

    Point dl,ul,ur,dr;
    dl.x=min_x;dl.y=min_y;
    ul.x=min_x;ul.y=max_y;
    ur.x=max_x;ur.y=max_y;
    dr.x=max_x;dr.y=min_y;

    // cout<<ul.x<<' '<<ul.y<<"        ";
    // cout<<ur.x<<' '<<ur.y<<endl;
    // cout<<dl.x<<' '<<dl.y<<"        ";
    // cout<<dr.x<<' '<<dr.y<<endl;

    if(cnt_x[min_x] == 1)
    {
        for(int i=0;i<4*n+1;i++)
        {
            if(min_x == pt[i].x)
            {
                cout<<pt[i].x<<' '<<pt[i].y<<endl;
                return 0;
            }
        }
    }
    if(cnt_x[max_x] == 1)
    {
        for(int i=0;i<4*n+1;i++)
        {
            if(max_x == pt[i].x)
            {
                cout<<pt[i].x<<' '<<pt[i].y<<endl;
                return 0;
            }
        }
    }
    if(cnt_y[min_y] == 1)
    {
        for(int i=0;i<4*n+1;i++)
        {
            if(min_y == pt[i].y)
            {
                cout<<pt[i].x<<' '<<pt[i].y<<endl;
                return 0;
            }
        }
    }
    if(cnt_y[max_y] == 1)
    {
        for(int i=0;i<4*n+1;i++)
        {
            if(max_y == pt[i].y)
            {
                cout<<pt[i].x<<' '<<pt[i].y<<endl;
                return 0;
            }
        }
    }

    for(int i=0;i<4*n+1;i++)
    {
        if(chk(dl,ul,pt[i]))
            continue;
        if(chk(ul,ur,pt[i]))
            continue;
        if(chk(ur,dr,pt[i]))
            continue;
        if(chk(dr,dl,pt[i]))
            continue;

        cout<<pt[i].x<<' '<<pt[i].y<<endl;
    }

    return 0;
}

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	int n;
	cin>>n;
	int p=4*n+1;
	int a[p],b[p];
	for(int i=0;i<p;i++){
		cin>>a[i]>>b[i];
	}
	int ma_x=-1,ma_y=-1,min_x=51,min_y=51;
	for(int i=0;i<p;i++){
		for(int g=0;g<p;g++){
			if(a[i]==a[g] && i!=g){
				if(ma_x<a[i])
					ma_x=a[i];
				if(min_x>a[i])
					min_x=a[i];
				}
			if(b[i]==b[g] && i!=g){
				if(ma_y<b[i])
					ma_y=b[i];
				if(min_y>b[i])
					min_y=b[i];
			}
		}
	}
	for(int i=0;i<p;i++){
		if(a[i]!=ma_x && a[i]!=min_x && b[i]!=ma_y && b[i]!=min_y && b[i]!=min_y || min_x>a[i] || ma_x<a[i] || ma_y<b[i] || min_y>b[i]){
			cout<<a[i]<<" "<<b[i];
				return 0;
			}
	}
}

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include <map>
#define fo(i,l,r) for(int i = l;i <= r;i++)
#define ll long long
using namespace std;
const int maxn = 55;
const ll mod = 1e9+7;
inline ll read(){
    ll x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){
        if (ch == '-')
            f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}
int n;
int x[maxn],y[maxn];
bool check(int x1,int x2,int y1,int y2){
    int cnt = 0,t=0;
    bool debug=false;
    if(x1==19&&x2==45&&y1==1&&y2==27)debug=true;
    fo(i,1,n){
        if(x[i]<x1||x[i]>x2||y[i]<y1||y[i]>y2){
            cnt++;
            t=i;
        }else if(x[i]!=x1&&x[i]!=x2&&y[i]!=y1&&y[i]!=y2){
            cnt++;
            t=i;
        }
        if(cnt>1)return false;
    }
    if(cnt == 0) return false;
    cout<<x[t]<<" "<<y[t];
    return true;
}
int main(){
    n=read();
    n = n*4+1;
    fo(i,1,n){
        x[i]=read();
        y[i]=read();
    }
    fo(i,0,50){
        fo(j,i,50){
            fo(k,0,50){
                fo(l,k,50){
                    if(check(i,j,k,l)) return 0;
                }
            }
        }
    }
    return 0;
}

/*

    Author      : Yash Sharma
    Institution : IIT Patna
    Country     : India

*/

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;
using namespace std;

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")

typedef long long ll;
typedef long double ld;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl "\n"
//#define mpq priority_queue<int,vector<int>,greater<int>>
#define debug(a) cerr << #a << ": " << a << endl
#define umii unordered_map<int64_t,int64_t>
#define ftt int t;cin>>t;for(int tt=1;tt<=t;++tt)
#define forr(i,n) for((i)=1;(i)<=(n);(i)++)
#define Rev(v) reverse(v.begin(),v.end());
#define Sort(v) sort(v.begin(),v.end());
#define Sum(v) accumulate(v.begin(),v.end(),0)
#define Input(v) for(auto &x:v)cin>>x;
#define mem(a,b) memset(a,b,sizeof(a))
#define deb(x) cout<<"\nhi"<<x<<"\n"
#define pq priority_queue<int>
#define dbg cout<<"\nhi\n"
#define sayy cout<<"YES\n"
#define sayn cout<<"NO\n"
#define int long long
#define double long double
#define pii pair<int,int>
#define mii map<int,int>
#define vb vector<bool>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define eb emplace_back
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define snd second
#define fst first

const int INF = numeric_limits<int>::max();
const int MOD = 1000000007;
const double PI = 3.1415926535898;
const int LIM = 100005;

int fpow( int x,int y) {
    int temp;
    if(y == 0)
        return 1;
    temp = fpow(x, y/2);
    if (y%2 == 0)
        return temp*temp;
    else
        return x*temp*temp;}

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

void sieve(int n) {
     bool prime[5*LIM];
     memset(prime, true, sizeof(prime));
     for (int p=2; p*p<=n; p++)
          if (prime[p] == true)
               for (int i=p*p; i<=n; i += p)
                    prime[i] = false;
     prime[1]=0;}

bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;

    // This is checked so that we can skip
    // middle five numbers in below loop
    if (n % 2 == 0 || n % 3 == 0)
        return false;

    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;

    return true;
}

map<int,int> primeFactors(int n)
{
    map<int, int> mp;
    while (n % 2 == 0)
    {
        if(mp.count(2) == 1)
            mp[2]++;
        else
            mp.insert({2,1});
        n = n/2;
    }
    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        while (n % i == 0)
        {
            if(mp.count(i) == 1)
                mp[i]++;
            else
                mp.insert({i,1});
            n = n/i;
        }
    }
    if (n > 2)
    {
        if(mp.count(n) == 1)
            mp[n]++;
        else
            mp.insert({n,1});
    }
    return mp;
}

//*************************************************************************************************************************

int32_t main()
{    fio;

    int n, x1, y1, x2, y2;
    cin>>n;
    vii v(4*n + 1);
    mii mpx, mpy;
    for(int i=1;i<=4*n+1;i++)
    {
        int x, y;
        cin>>x>>y;
        v[i-1] = {x, y};
        mpx[x]++;
        mpy[y]++;
    }
    vi xcoord, ycoord;
    for(auto ele : mpx)
    {
        if(ele.snd >= n)
            xcoord.pb(ele.fst);
    }
    for(auto ele : mpy)
    {
        if(ele.snd >= n)
            ycoord.pb(ele.fst);
    }
    Sort(xcoord);
    Sort(ycoord);
    x1 = xcoord[0], x2 = xcoord.back();
    y1 = ycoord[0], y2 = ycoord.back();
    for(auto ele : v)
    {
        if(ele.fst == x1 && (ele.snd >= y1 && ele.snd <= y2))
            continue;
        if(ele.fst == x2 && (ele.snd >= y1 && ele.snd <= y2))
            continue;
        if(ele.snd == y1 && (ele.fst >= x1 && ele.fst <= x2))
            continue;
        if(ele.snd == y2 && (ele.fst >= x1 && ele.fst <= x2))
            continue;
        cout<<ele.fst<<" "<<ele.snd<<endl;
        return 0;
    }
    return 0;
}

#include<stdio.h>
#include<algorithm>
#include<cmath>
using namespace std;

struct point
{
	int x,y;
}p[45];

int visx[55],visy[55];

int main()
{
    int n;
    scanf("%d",&n);
    int minx,miny,maxx,maxy;
    minx=miny=51;
    maxx=maxy=0;
    for(int i=0;i<4*n+1;i++)
	{
		scanf("%d%d",&p[i].x,&p[i].y);
		visx[p[i].x]++;
		visy[p[i].y]++;
		if(visx[p[i].x]>1&&p[i].x<minx)	minx=p[i].x;
		if(visx[p[i].x]>1&&p[i].x>maxx)	maxx=p[i].x;
		if(visy[p[i].y]>1&&p[i].y<miny)	miny=p[i].y;
		if(visy[p[i].y]>1&&p[i].y>maxy)	maxy=p[i].y;
	}
    for(int i=0;i<4*n+1;i++)
	{
		if(p[i].x<minx || p[i].x>maxx || p[i].y>maxy || p[i].y<miny)	printf("%d %d",p[i].x,p[i].y);
		else if((p[i].x==minx || p[i].x==maxx) && (p[i].y>maxy || p[i].y<miny))	printf("%d %d",p[i].x,p[i].y);
		else if((p[i].y==miny || p[i].y==maxy) && (p[i].x>maxx || p[i].x<minx))	printf("%d %d",p[i].x,p[i].y);
		else if( (p[i].x>minx && p[i].x<maxx) && (p[i].y!=maxy && p[i].y!= miny ))	printf("%d %d",p[i].x,p[i].y);
	}
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <memory>

using namespace std;

int n, N;

int xx[51], yy[51];

bool is[41];

int main() {

	cin >> N;

	n = 4 * N + 1;

	vector<pair<int, int>> point(n);

	memset(xx, 0, sizeof(xx));
	memset(yy, 0, sizeof(yy));

	int lowx = -1, lowy = -1, highx = -1, highy = -1;

	int x, y;
	for (int i = 0; i < n; i++) {
		cin >> x >> y;
		point[i] = make_pair(x, y);
		xx[x]++;
		yy[y]++;
	}

	for (int i = 0; i < 52; i++) {
		if (xx[i] >= N) {
			if (lowx == -1)
				lowx = i;
			else
				highx = i;
		}

		if (yy[i] >= N) {
			if (lowy == -1)
				lowy = i;
			else
				highy = i;
		}
	}

	for (int i = 0; i < n; i++) {
		if ((point[i].first == lowx || point[i].first == highx) && (point[i].second >= lowy && point[i].second <= highy)) {

		}
		else if ((point[i].second == lowy || point[i].second == highy) && (point[i].first >= lowx && point[i].first <= highx)) {

		}
		else {
			cout << point[i].first << ' ' << point[i].second;
			break;
		}
	}

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

#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<unordered_set>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod;
#define N 55
ll n,x[N],y[N];
bool solve(ll a,ll b,ll c,ll d){
  vector<ll> v;
  for(int i=0;i<n*4+1;i++){
    if(not(a<=x[i]&&x[i]<=c&&b<=y[i]&&y[i]<=d)){
      v.push_back(i);
      continue;
    }
    bool ok=0;
    if(x[i]==a)ok=1;
    if(x[i]==c)ok=1;
    if(y[i]==b)ok=1;
    if(y[i]==d)ok=1;
    if(ok==0)v.push_back(i);
  }
  if(v.size()==1){
    cout<<x[v[0]]<<" "<<y[v[0]]<<endl;
    return 1;
  }
  return 0;
}
int main(){
  cin>>n;
  for(int i=0;i<n*4+1;i++)cin>>x[i]>>y[i];
  for(int a=0;a<N;a++)for(int b=0;b<N;b++)for(int c=a+1;c<N;c++)for(int d=b+1;d<N;d++){
    if(solve(a,b,c,d))return 0;
  }
  return 0;
}

#include <bits/stdc++.h>

#define PB push_back
#define fi first
#define se second

using namespace std;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<char> vc;

const string ln = "\n";
const int INF = 2000000000;
const string alph = "abcdefghijklmnopqrstuvwxyz";

void printv(vi &s) {
    for (int i = 0; i < s.size(); i++) {
        cout << s[i] << " ";
    }
    cout << ln;
}

int ind(char t) {
    for (int i = 0; i < 26; i++) {
        if (alph[i] == t) {
            return i;
        }
    }
}

int main() {

        int n;
        cin >> n;

        vector< pair<int, int> > s(4*n+1);

        for (int i = 0; i <= n*4; i++) {
            cin >> s[i].fi >> s[i].se;
        }

        for (int ex = 0; ex <= n*4; ex++) {
            int lx = 51, rx = -1, uy = -1, by = 51;
            for (int i = 0; i <= n*4; i++) {
                if (i == ex) {
                    continue;
                }
                lx = min(s[i].fi, lx);
                rx = max(s[i].fi, rx);
                by = min(s[i].se, by);
                uy = max(s[i].se, uy);
            }
            bool f = (rx == lx || by == uy || rx-lx == uy-by);
            for (int i = 0; i <= n*4; i++) {
                if (i == ex
                    || s[i].fi == lx && s[i].se >= by && s[i].se <= uy
                    || s[i].fi == rx && s[i].se >= by && s[i].se <= uy
                    || s[i].se == by && s[i].fi >= lx && s[i].fi <= rx
                    || s[i].se == uy && s[i].fi >= lx && s[i].fi <= rx) {
                    continue;
                }
                f = 0;
            }
            if (f) {
                cout << s[ex].fi << " " << s[ex].se << ln;
                break;
            }
        }
}

/*
ID: leezhen
TASK: practice
LANG: C++11
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <bitset>

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;
typedef long long ll;

// struct
#define inf 1e9
#define REP(i, a, b) for(int i=int(a); i<int(b); i++)
// data
int n;
vii points;

bool inside(ii& a, ii& b, ii& c) {
  if((a.first == b.first || a.first == c.first) && a.second >= b.second && a.second <= c.second) return true;
  if((a.second == b.second || a.second == c.second) && a.first >= b.first && a.first <= c.first) return true;
  return false;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int cntx[60] = {0}, cnty[60] = {0};
  cin >> n;
  int x, y;
  REP(i, 0, 4 * n + 1) {
    cin >> x >> y;
    points.push_back(ii(x, y));
    cntx[x]++;
    cnty[y]++;
  }
  ii bl = ii(100, 100), tr = ii(0, 0);
  REP(i, 0, 60) {
    if(cntx[i] >= 2) {
      bl.first = min(bl.first, i);
      tr.first = max(tr.first, i);
    }
    if(cnty[i] >= 2) {
      bl.second = min(bl.second, i);
      tr.second = max(tr.second, i);
    }
  }
  REP(i, 0, 4 * n + 1) {
    if(!inside(points[i], bl, tr)) {
      cout << points[i].first << " " << points[i].second << endl;
      return 0;
    }
  }
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl '\n'
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
    std::ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n;
    cin>>n;

    vector < pair <ll,ll> > vec;

    for(ll i=0;i<4*n+1;i++){
        ll a,b;
        cin>>a>>b;
        vec.push_back({a,b});
    }

    sort(vec.begin(),vec.end());

    for(ll i=0;i<vec.size();i++)
    {
        ll r1 = -1;
        ll r2 = INT_MAX;
        ll c1 = -1;
        ll c2 = INT_MAX;
        for(ll j=0;j<vec.size();j++){
            if(i==j)continue;

            r1 = max(r1,vec[j].first);
            c1 = max(c1,vec[j].second);
            r2 = min(r2,vec[j].first);
            c2 = min(c2,vec[j].second);
        }
       // cout<<r1<<" "<<c1<<" "<<r2<<" "<<c2<<endl;
        ll flg = 1;
        for(ll j=0;j<vec.size();j++){
        	if(i==j) continue;
        	if((vec[j].first==r2||vec[j].first==r1)&&vec[j].second>=c2&&vec[j].second<=c1){
        		//ok
        	}
        	else if((vec[j].second==c2||vec[j].second==c1)&&vec[j].first>=r2&&vec[j].first<=r1){
        		//ok
        	}
        	else {
        		flg=0;break;
        	}
        }
        //cout<<i<<" * "<<flg<<endl;
        if(flg == 1){
            cout<<vec[i].first<<" "<<vec[i].second<<endl; return 0;
        }

    }
}

#include <bits/stdc++.h>

using namespace std;

#define f first

#define s second

int n, i, j, mx=-1, my=-1, nx=1e2, ny=1e2, k;

int main()
{
    cin >> n;

    n=4*n+1;

    vector < pair < int, int > > b(n);

    for (auto &i:b) cin >> i.f >> i.s;

    for (j=0; j<n; j++)
    {
        vector < pair < int, int > > a;

        for (i=0; i<n; i++) if (i!=j) a.push_back(b[i]);

        mx=-1, my=-1, nx=1e2, ny=1e2;

        for (auto &i:a) mx=max(mx, i.f), my=max(my, i.s), nx=min(nx, i.f), ny=min(ny, i.s);
        k=0;
        for (auto &i:a)
        {

        if (i.s!=my && i.f!=mx && i.f!=nx && i.s!=ny) break;

        k++;
        }

        if (k==n) return cout << b[j].f << ' ' << b[j].s, 0;
    }
}

#include <bits/stdc++.h>

using namespace std;

#define fo(i,n)   for(i=0;i<(n);++i)
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define endl '\n'
#define PI 3.1415926535897932384626433832795
#define all(x) x.begin(), x.end()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

typedef long long ll;
typedef long double ld;

typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;

const ll inf = LONG_MAX;
const ll arr = 1000000; /// 10^6

bool comp(pll a, pll b)
{
    if(a.first==b.first) return a.second<b.second; else return a.first<b.first;
}

int main(void)
{
    ll n;
    cin >> n;
    vector<pll> v(4*n+1);

    for(int i=0; i<4*n+1; i++)
    {
        cin >> v[i].first >> v[i].second;
    }

    sort(v.begin(), v.end(), comp);

    for(int i=0; i<4*n+1; i++)
    {
        pll temp = v[i];
        v.erase(v.begin()+i);
        sort(v.begin(), v.end(), comp);

        pll leftBottom = v[0];
        pll leftTop;
        ll mx = -1;
        for(int i=0; i<4*n; i++)
        {
            if(v[i].first == leftBottom.first)
                mx = max(mx, v[i].second);
        }
        //cout << mx << endl;
        leftTop = {leftBottom.first, mx};
        pll rightTop = v[v.size()-1];
        ll mn = LLONG_MAX;
        for(int i=0; i<4*n; i++)
        {
            if(v[i].first == rightTop.first)
                mn = min(mn, v[i].second);
        }
        pll rightBottom = {rightTop.first, mn};

        bool f = false;
        if(leftBottom.first==leftTop.first && rightBottom.first == rightTop.first &&
           leftBottom.second == rightBottom.second && leftTop.second == rightTop.second)
            f = true;

        /*
        cout << leftBottom.first << " " << leftBottom.second << endl;
        cout << leftTop.first << " " << leftTop.second << endl;
        cout << rightTop.first << " " << rightTop.second << endl;
        cout << rightBottom.first << " " << rightBottom.second << endl;
        */

        if(!f)
        {
            v.push_back(temp);
            sort(v.begin(), v.end(), comp);
            continue;
        }

        for(int i=0; i<4*n; i++)
        {
            if(v[i].first == leftBottom.first && v[i].second>=leftBottom.second && v[i].second<=leftTop.second)
                continue;
            else
            if(v[i].first == rightBottom.first && v[i].second>=leftBottom.second && v[i].second<=leftTop.second)
                continue;
            else
            if(v[i].second == leftBottom.second && v[i].first>=leftBottom.first && v[i].first<=rightBottom.first)
                continue;
            else
            if(v[i].second == leftTop.second && v[i].first>=leftBottom.first && v[i].first<=rightBottom.first)
                continue;
            else
            {
                f = false;
            }
        }

        if(!f)
        {
            v.push_back(temp);
            sort(v.begin(), v.end(), comp);
            continue;
        } else
            return cout << temp.first << " " << temp.second << endl, 0;
    }

    return 0;
}

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn=3e5+10;
bool vis[205][205];
int x[205],y[205];
int main()
{
    ios::sync_with_stdio(0);
    int n;
    cin>>n;
    for(int i=1; i<=4*n+1; i++)
    {
        cin>>x[i]>>y[i];
        vis[x[i]][y[i]]=1;
    }
    for(int i=1; i<=4*n+1; i++)
    {
        int f=1;
        int xx=x[i];
        int yy=y[i];
        for(int j=1; j<=n; j++)
        {
            if(vis[xx+j][yy])
                continue;
            else
                f=0;
        }
        for(int j=1; j<=n; j++)
        {
            if(vis[xx][yy+j])
                continue;
            else
                f=0;
        }
        for(int j=1; j<=n; j++)
        {
            if(vis[xx+n][yy+j])
                continue;
            else
                f=0;
        }
        for(int j=1; j<=n; j++)
        {
            if(vis[xx+j][yy+n])
                continue;
            else
                f=0;
        }
        if(f)
        {
            vis[xx][yy]=0;
            for(int j=1; j<=n; j++)
                vis[xx+j][yy]=0;
            for(int j=1; j<=n; j++)
                vis[xx][yy+j]=0;
            for(int j=1; j<=n; j++)
                vis[xx+n][yy+j]=0;
            for(int j=1; j<=n; j++)
                vis[xx+j][yy+n]=0;
            break;
        }
    }
    for(int i=1; i<=4*n+1; i++)
    {
        if(vis[x[i]][y[i]]==1)
            cout<<endl<<x[i]<<" "<<y[i]<<endl;
    }
}

#include <bits/stdc++.h>
typedef long long ll;
#define MAX 1000005
#define M_p 3.1415926
#define mod 1000000007
//	memset(a,0,sizeof(a));
using namespace std;
int main()
{

		int n;
		cin>>n;
		pair<int,int> p[4*n+2];
		int max_x=-55,max_y=-55,min_x = 55,min_y =55;
		for(int i=0;i<4*n+1;i++)
		{
			cin>>p[i].first>>p[i].second;
			if(max_x<p[i].first)
				max_x = p[i].first;
			if(min_x>p[i].first)
			{
				min_x = p[i].first;
			}
			if(min_y>p[i].second)
				min_y = p[i].second;
			if(max_y<p[i].second)
				max_y = p[i].second;
		}
		//cout<<max_x<<" "<<min_x<<" "<<max_y<<" "<<min_y<<endl;
		for(int i=0;i<4*n+1;i++)
		{
			if(p[i].first == max_x || p[i].first==min_x || p[i].second==max_y || p[i].second==min_y)
				continue;
			else
			{
				cout<<p[i].first<<" "<<p[i].second;
				break;
			}
		}

	return 0;
}

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

int n;

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

    cin >> n;
    n = 4*n+1;
    vector<pair<int,int>> v(n);
    for(int i=0;i<n;i++){
        cin >> v[i].first >> v[i].second;
    }
    for(int i=0;i<n;i++){
        vector<pair<int,int>> temp = v;
        pair<int,int> ans = temp[i];
        temp.erase(temp.begin()+i);
        int x1 = 60, x2 = -1, y1 = 60, y2 = -1;
        for(auto e:temp){
            x1 = min(x1,e.first);
            x2 = max(x2,e.first);
            y1 = min(y1,e.second);
            y2 = max(y2,e.second);
        }
        bool flag = true;
        for(auto e:temp){
            if(e.first == x1 || e.first == x2){
                if(e.second > y2 || e.second < y1){
                    flag = false;
                }
            }else if(e.second == y1 || e.second == y2){
                if(e.first > x2 || e.first < x1){
                    flag = false;
                }
            }else{
                flag = false;
            }
            if(!flag)break;
        }
        if(flag){
            cout << ans.first << " " << ans.second << "\n";
            return 0;
        }
    }

    return 0;
}

#include <bits/stdc++.h>

#if !defined(ONLINE_JUDGE)
#include "prettyprint.hpp"
#endif

#define ent(smth) smth.begin(), smth.end()
#define fori(i,n) for(intel i = 0; i < n; i++)
#define forn(n) for(intel i = 0; i < n; ++i)
#define forx(i,x,n) for(intel i = x; i < n; i++)
#define iter_for(_cont, _iterator) for(auto _iterator  = _cont.begin(); _iterator != _cont.end(); ++_iterator)

using namespace std;
typedef long long intel;
typedef pair<int, int> pInt;

bool checkforSquare(vector<pInt> Square, pInt Max, pInt Min)
{
  //  cout << Square << endl;
  //  cout << Max << Min << endl;

    int l = Square.size();
    int k = 0, k2 = 0, total = 0;
    for(auto &x : Square)
    {
        if(x.first == Max.first || x.second == Max.second) k++;
        if(x.first == Min.first || x.second == Min.second) k2++;
        if(x.first == Max.first || x.second == Max.second || x.first == Min.first || x.second == Min.second) total++;
    }
    return total == l && k >= 2 && k2 >= 2;
}
int main()
{
    int n; cin >> n;
    vector<pInt> a(4*n+1);
    for(auto &x : a) cin >> x.first >> x.second;
    for(int i = 0; i < 4*n + 1; i++)
    {
        pInt odd = a[i];
        pInt Max = {INT_MIN, INT_MIN};
        pInt Min = {INT_MAX, INT_MAX};
        vector<pInt> Sqr;
        for(int j = 0; j < 4*n + 1; j++)
        {
            if(i == j) continue;
            Max.first = max(Max.first, a[j].first);
            Max.second = max(Max.second, a[j].second);
            Min.first = min(Min.first, a[j].first);
            Min.second = min(Min.second, a[j].second);
            Sqr.push_back(a[j]);
        }
        if(checkforSquare(Sqr, Max, Min)) {
            cout << odd.first << " " << odd.second << endl;
            exit(0);
        }
    }
}

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string.h>
#include <queue>
#include <math.h>
#include <set>
using namespace std;

typedef long long ll;
#define FOR(i,n,m) for(int i=n; i<m; i++)
#define ROF(i,n,m) for(int i=n; i>m; i--)
#define ri(a) scanf("%d",&a)
#define rii(a,b) ri(a),ri(b)
#define riii(a,b,c) rii(a,b),ri(c)
#define lri(a) scanf("%lld",&a)
#define lrii(a,b) lri(a),lri(b)
#define _1 first
#define _2 second
struct trip{int a, b, c;};

const int INF = 0x3f3f3f3f;
const ll INFLL = 1e18;
const int MOD = 1e9+7;
const int alphabet = 26;
const int MAXINT = 2e5+1;

const int N = 51; 					// ________---------------
int p, a, b, row[N], col[N], n;
bool M[N][N];

int main(){
	ri(n);
	p = 4*n+1;
	while(p--){
		rii(a,b);
		M[a][b] = 1;
	}

	FOR(i,0,N) FOR(j,0,N) row[i] += M[i][j];
	FOR(i,0,N) FOR(j,0,N) col[j] += M[i][j];

	int rowl=-1, rowr=-1, coll=-1, colr=-1;
	for(int i=0; i<N && rowl==-1; i++) if( row[i] ) rowl = i;
	for(int i=N-1; i>=0 && rowr==-1; i--) if( row[i] ) rowr = i;
	for(int i=0; i<N && coll==-1; i++) if( col[i] ) coll = i;
	for(int i=N-1; i>=0 && colr==-1; i--) if( col[i] ) colr = i;

	int x = -1, y = -1;

	if( row[rowl] != n+1 ) x = rowl;
	else if( row[rowr] != n+1 ) x = rowr;

	if( col[coll] != n+1 ) y = coll;
	else if( col[colr] != n+1 ) y = colr;

	if( x==-1 && y==-1 ){
		FOR(i,rowl+1,rowr) if( row[i] != 2 ) x = i;
		FOR(i,coll+1,colr) if( col[i] != 2 ) y = i;
	}

	cout << x << " " << y << endl;

    return 0;
}

#pragma GCC optimize ("O3")
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <stack>
#include <unordered_map>
#define lld long long int
#define dbg1(vari1) cerr<<#vari1<<" = "<<(vari1)<<endl;
#define dbg2(vari1,vari2) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<endl;
#define dbg3(vari1,vari2,vari3) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<" "<<#vari3<<" = "<<(vari3)<<endl;
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	vector <pair <int,int> > v;
	int xmax=-1e9,ymax=-1e9,xmin=1e9,ymin=1e9;
    int arr[51]={0};
	for(int i=0;i<4*n+1;i++)
	{
		int a,b;
		cin >> a >> b;
		v.push_back({a,b});
		arr[a]+=1;
	}
	for(int i=0;i<51;i++)
	{
		if(arr[i]>=n)
		{
			xmin=min(i,xmin);
			xmax=max(i,xmax);
		}
	}
	// dbg2(xmin,ymin);
	// dbg2(xmax,ymax);
	for(int i=0;i<4*n+1;i++)
	{
		if(v[i].first==xmin||v[i].first==xmax)
		{
			if((v[i].second)<xmin||v[i].second>xmax)
			{
				cout << v[i].first << " " << v[i].second ;
				break;
			}
		}
		else if(v[i].second==xmin||v[i].second==xmax)
		{
			if(v[i].first<xmin||v[i].first>xmax)
			{
				cout << v[i].first << " " << v[i].second ;
				break;
			}
		}
		else
		{
		    cout <<v[i].first <<" "<<v[i].second;
		}
	}
}

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int maxn=3e5+10;
bool vis[505][505];
int x[205],y[205];
int main()
{
    ios::sync_with_stdio(0);
    memset(vis,0,sizeof(vis));
    int n;
    cin>>n;
    for(int i=1; i<=4*n+1; i++)
    {
        cin>>x[i]>>y[i];
        vis[x[i]][y[i]]=1;
    }
    for(int i=1; i<=4*n+1; i++)
    {
        int f=1;
        int xx=x[i];
        int yy=y[i];
        for(int j=1; j<=n; j++)
        {
            if(!vis[xx+j][yy])
                f=0;
        }
        for(int j=1; j<=n; j++)
        {
            if(!vis[xx][yy+j])
                f=0;
            }
        for(int j=1; j<=n; j++)
            if(!vis[xx+n][yy+j])
                f=0;

        for(int j=1; j<=n; j++)
        {
            if(!vis[xx+j][yy+n])
                f=0;
        }
        if(f)
        {
            vis[xx][yy]=0;
            for(int j=1; j<=n; j++)
                vis[xx+j][yy]=0;
            for(int j=1; j<=n; j++)
                vis[xx][yy+j]=0;
            for(int j=1; j<=n; j++)
                vis[xx+n][yy+j]=0;
            for(int j=1; j<=n; j++)
                vis[xx+j][yy+n]=0;
            break;
        }
    }
    for(int i=1; i<=4*n+1; i++)
    {
        if(vis[x[i]][y[i]]==1)
        {
            cout<<x[i]<<" "<<y[i]<<endl;
            break;
        }
    }
}

#include <bits/stdc++.h>

#define ii pair<int, int>
using namespace std;

int n;
ii ar[50];

bool check(int x)
{
	vector<ii> vec;
	for (int i = 0; i < n; ++i)
		if (i != x)
			vec.push_back(ar[i]);

	int north, south, west, east;
	north = south = vec[0].second;
	west = east = vec[0].first;
	for (auto x : vec)
	{
		north = max(north, x.second);
		south = min(south, x.second);
		east = max(east, x.first);
		west = min(west, x.first);
	}

	for (int i = 1; i < vec.size() - 1; ++i)
	{
		if ((vec[i].first == west || vec[i].first == east) &&
			south <= vec[i].second && vec[i].second <= north)
			continue;
		if ((vec[i].second == south || vec[i].second == north) &&
			west <= vec[i].first && vec[i].first <= east)
			continue;
		return false;
	}

	return true;
}

int main()
{
	cin >> n; n = 4*n + 1;
	for (int i = 0; i < n; ++i)
		cin >> ar[i].first >> ar[i].second;
	sort(ar, ar+n);

	for (int i = 0; i < n; ++i)
	{
		if (check(i))
		{
			cout << ar[i].first << " " << ar[i].second << '\n';
			return 0;
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
int n;
pair<int,int> point[100];
bool vis[60][60],v2[60][60];
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		cin>>point[i].first>>point[i].second;
		vis[point[i].first][point[i].second]=true;
	}
	for(int i=1;i<=50;i++){//SIZE
		for(int j=0;j<=50;j++){
			for(int k=0;k<=50;k++){//左上
				memset(v2,0,sizeof(v2));
				for(int l=0;l<i;l++){//上
					v2[j][k+l]=true;
				}
				for(int l=0;l<i;l++){//左
					v2[j+l][k]=true;
				}
				for(int l=0;l<i;l++){//下
					v2[j+i-1][k+l]=true;
				}
				for(int l=0;l<i;l++){//右
					v2[j+l][k+i-1]=true;
				}
				int cnt=0;
				pair<int,int> pos;
				for(int l=1;l<=4*n+1;l++){
					if(!v2[point[l].first][point[l].second]){
						cnt++;
						pos=point[l];
					}
				}
				if(cnt==1){
					cout<<pos.first<<' '<<pos.second<<endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

#include<bits/stdc++.h>
#define mod 10000000007
#define ll long long int
#define pb push_back
#define V vector
#define endl "\n"
#define mp make_pair
#define ff first
#define ss second
using namespace std;
int main()
{
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,minx=INT_MAX,miny=INT_MAX,maxx=-1,maxy=-1,ind[4],freq[4]={0};
	cin>>n;
	ll a[4*n+1][2];
	for(int i=0;i<((4*n)+1);i++)
	{
	cin>>a[i][0]>>a[i][1];
	if(a[i][0]>maxx)
	{
	maxx=a[i][0];
	freq[0]=1;
	ind[0]=i;
	}
	else if(a[i][0]<minx)
	{
	minx=a[i][0];
	freq[1]=1;
	ind[1]=i;
	}
	if(a[i][1]>maxy)
	{
	maxy=a[i][1];
	freq[2]=1;
	ind[2]=i;
	}
	else if(a[i][1]<miny)
	{
	miny=a[i][1];
	freq[3]=1;
	ind[3]=i;
	}
	if(a[i][0]==maxx)
	freq[0]++;
	if(a[i][0]==minx)
	freq[1]++;
	if(a[i][1]==maxy)
	freq[2]++;
	if(a[i][1]==miny)
	freq[3]++;
	}

	for(int i=0;i<4;i++)
	{
	if(freq[i]<=2)
	{
		cout<<a[ind[i]][0]<<" "<<a[ind[i]][1];
		return 0;
	}

//	cout<<freq[i]<<" ";
	}

//	cout<<minx<<" "<<miny<<" "<<maxx<<" "<<maxy<<" ";
	for(int i=0;i<(4*n+1);i++)
	{
		int flag=0;
		if(a[i][0]==minx)
		flag=1;
		else if(a[i][0]==maxx)
		flag=1;
		if(a[i][1]==miny)
		flag=1;
		else if(a[i][1]==maxy)
		flag=1;
		if(flag==0)
		{cout<<a[i][0]<<" "<<a[i][1];
		return 0;
		}
	}

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {

  int n;
  cin >> n;

  for (int i = 0; i < 4 * n + 1; ++i) {
    int x, y;
    cin >> x >> y;
    if (x == 0 && y > n) cout << x << " " << y;
    else if (y == 0 && x > n) cout << x << " " << y;
    else if (x == n && y > n) cout << x << " " << y;
    else if (y == n && x > n) cout << x << " " << y;
    else if (x > n || y > n) cout << x << " " << y;
    else if (x > 0 && x < n && y > 0 && y < n) cout << x << " " << y;
  }

  return 0;
}

#include <cstdio>
#include <algorithm>

using namespace std;

#define DEBUG 0
#define ONLINE_JUDGE

#define MAXN 100

typedef pair<int, int> pii;

bool Check(pii p[], int n) {
	static int rec[MAXN];
	int len = 0;
	int miny = 0x3f3f3f3f, maxy = 0xc0c0c0c0;

	sort(p, p+n);
	int line = p[0].first;
	int i;
	for (i = 0; i < n && p[i].first == line; ++i) {
		miny = min(miny, p[i].second);
		maxy = max(maxy, p[i].second);
	}
	if (i == n) {
		return false;
	}
	int start = i;
	line = p[n-1].first;
	for (; i < n && p[i].first != line; ++i) {
		miny = min(miny, p[i].second);
		maxy = max(maxy, p[i].second);
	}
	int ended = i;

	for (i = start; i < ended; ++i) {
		rec[len++] = p[i].second;
	}
	sort(rec, rec+len);
	len = unique(rec, rec+len) - rec;
	if (len > 2) return false;
	if (0 == len) return true;
	if (1 == len) {
		return (rec[0] <= miny || rec[0] >= maxy);
	} else {	//2
		return (rec[0] <= miny && rec[1] >= maxy);
	}
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	static pair<int, int> points[MAXN];
	static pair<int, int> now[MAXN];
	int n;

	scanf("%d", &n);
	n = 4 * n + 1;
	for (int i = 1; i <= n; ++i) {
		scanf("%d%d", &points[i].first, &points[i].second);
	}
	int ans;
	for (ans = 1; ans <= n; ++ans) {
		int len = 0;
		for (int j = 1; j <= n; ++j) {
			if (j != ans) {
				now[len++] = points[j];
			}
		}
		if (Check(now, len)) {
			break;
		}
	}
	printf("%d %d", points[ans].first, points[ans].second);

	return 0;
}

/*
 * =====================================================================================
 *
 *       Filename:  c1.cpp
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  07/07/2019 09:57:48
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Luigi Berducci (), berducci.1647887@studenti.uniroma1.it
 *        Company:  University of Rome La Sapienza
 *
 * =====================================================================================
 */

#include <iostream>
#include <algorithm>

#define MAXN 4*10+1

using namespace std;

int n;
pair<int, int> P[MAXN];

bool sort_p(pair<int, int> p1, pair<int, int> p2){
    return p1.first < p2.first && (p1.first != p2.first || p1.second < p2.second);
}

pair<int, int> run(){
    int first_min_y = P[0].second;
    int first_max_y = P[0].second;
    for(int i=1; i<=n+1; i++){
        first_min_y = min(first_min_y, P[i].second);
        first_max_y = max(first_max_y, P[i].second);
    }
    int last_min_y = P[3*n-1].second;
    int last_max_y = P[3*n-1].second;
    /* cout << "tail P " << P[3*n-1].first << " " << P[3*n-1].second << "\n"; */
    for(int i=3*n; i<4*n+1; i++){
        /* cout << "tail P " << P[i].first << " " << P[i].second << "\n"; */
        last_min_y = min(last_min_y, P[i].second);
        last_max_y = max(last_max_y, P[i].second);
    }

    /* cout << "FIRST Y " << first_min_y << " " << first_max_y << "\n"; */
    /* cout << "LAST Y " << last_min_y << " " << last_max_y << "\n"; */

    int minx = P[1].first;
    int maxx = P[4*n-1].first;
    int miny=-1;
    int maxy=-1;
    if(first_min_y == last_min_y && first_max_y == last_max_y){
            // ideal case: error in the middle
            miny = first_min_y;
            maxy = first_max_y;
    } else if(first_min_y == last_min_y){
        miny = first_min_y;
        maxy = min(first_max_y, last_max_y);
    } else if(first_max_y == last_max_y){
        miny = max(first_min_y, last_min_y);
        maxy = first_max_y;
    }

    /* cout << "MinX " << minx << " "; */
    /* cout << "MaxX " << maxx << "\n"; */
    /* cout << "MinY " << miny << " "; */
    /* cout << "MaxY " << maxy << "\n"; */

    for(int i=0; i<4*n+1; i++){
        int x = P[i].first;
        int y = P[i].second;
        if(!((( x == minx || x == maxx ) && ( y>=miny && y <= maxy )) || (( y == miny || y == maxy ) && ( x>=minx && x <= maxx ))))
            return make_pair(x, y);
    }
    return make_pair(666, 666);
}

int main(){
    cin >> n;
    for(int i=0; i<4*n+1; i++){
        int x,y;
        cin >> x >> y;
        P[i] = make_pair(x,y);
    }

    sort(P, P+4*n+1, sort_p);
    /* for(int i=0; i<4*n+1; i++){ */
    /*     cout << "I: " << i << "  " << P[i].first << " " << P[i].second << "\n"; */
    /* } */
    /* cout << "\n"; */

    pair<int, int> out = run();
    while(out.first>50 && out.second > 50);
    cout << out.first << " " << out.second << "\n";
    return 0;
}

#include<bits/stdc++.h>
#include<algorithm>
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include  <stdio.h>
#include   <math.h>
#include   <time.h>
#include   <vector>
#include   <bitset>
#include    <queue>
#include      <map>
#include      <set>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n;i>=a;i--)
typedef long long ll;
const int maxn = 500;
const ll Mod = 1e9 + 7;
ll powmod(ll a,ll b) {ll res=1;a%=Mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%Mod;a=a*a%Mod;}return res;}
int gcd(int a,int b) { return b?gcd(b,a%b):a;}
//head1
struct haha{
    int x,y;
}arr[maxn],res;

    int n;
    bool bo,boo;

int main()
{
    scanf("%d",&n);
    rep(a,1,4*n+1)
        scanf("%d%d",&arr[a].x,&arr[a].y);
    boo = true;
    rep(a,0,50) if(boo)
        rep(b,0,50) if(boo)
            rep(c,1,50-max(a,b))if(boo){
                res.x = res.y = -1;
                bo = false;
                rep(d,1,4*n+1){
                  //  printf("----%d %d\n",arr[d].x,arr[d].y);
                    if(((arr[d].x == a || arr[d].x == a+c) && arr[d].y >= b && arr[d].y <= b+c) ||
                       ((arr[d].y == b || arr[d].x == b+c) && arr[d].y >= a && arr[d].y <= a+c)){
                         //   printf("    %d\n",d);
                            if(res.x != -1){
                                bo = true;
                                break;
                            }
                            else{
                                res.x = arr[d].x;
                                res.y = arr[d].y;
                            }
                       }
                }
                if(bo) continue;
             //   printf("%d %d %d\n",a,b,c);
                boo = false;
            }
    printf("%d %d\n",res.x,res.y);
    return 0;
}

/**************************************************************
    Problem: ????
    User: Big_Red_Dates
    Language: GNU_C++11
    Result: Accepted
    Time:0 ms
    Memory:0 kb
    length:0 kb
    score: inf
****************************************************************/
//CLOCKS_PER_SEC
using namespace std;
#include<bitset>
#include<deque>
#include<stdint.h>
#include<set>
#include<stack>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<cstring>
#include<ctime>
#include<map>
#define sqr(x) (x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while ((c=getchar())==' ');x=c;}
inline void writes(string s){puts(s.c_str());}
inline void writeln(){writes("");}
inline void writei(int x){if (x<0){putchar('-');x=abs(x);}if (!x) putchar('0');char a[25];int top=0;while (x){a[++top]=(x%10)+'0';x/=10;}while (top){putchar(a[top]);top--;}}
inline void writell(ll x){if (x<0){putchar('-');x=abs(x);}if (!x) putchar('0');char a[25];int top=0;while (x){a[++top]=(x%10)+'0';x/=10;}while (top){putchar(a[top]);top--;}}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define si set<int>
#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x1bbbbbbbbbbbbbbbll
#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
int n,m,i,j,c1[55],c2[55],s1,s2;
int main(){
	read(n);
	rep(i,n+n+n+n+1){
		int x,y;read(x);read(y);
		c1[x]++;c2[y]++;
	}s1=s2=-1;
	forup(i,0,50)if(c1[i]!=n+1&&c1[i]!=0&&c1[i]!=2)s1=i;
	forup(i,0,50)if(c2[i]!=n+1&&c2[i]!=0&&c2[i]!=2)s2=i;
	if(s1==-1&&n==2){
		forup(i,0,50){
			if(c1[i]){
				if(s1==-1)s1=i;
				else{
					s1=i;
					break;
				}
			}
		}
		forup(i,0,50){
			if(c2[i]){
				if(s2==-1)s2=i;
				else{
					s2=i;
					break;
				}
			}
		}
	}
	printf("%d %d\n",s1,s2);
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>
#include <stack>
#include <cmath>
#include <string>
#include <deque>
#include <map>
#include <iomanip>
#include <math.h>
#include <cstdlib>
#include <stdlib.h>
#include <set>
#include <unordered_set>
#include <cassert>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define FastIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < n; ++i)
#define pb push_back
#define fr first
#define sc second
typedef long long ll;
typedef long double ld;
const ll p = 997;
const ll base = 1e9 + 7;
const ll MAXN = 5e5;
const ll INF = 1e9;
const ll MOD = 1e9;
const double PII = 3.14159265358979323846264338327950288419716939937510;
const double Epsilon = 1.19209e-9;
const ld fi = 1.6180339887498948482;
const ll one = 2147483647;
const ll two = 1e9 + 7;
void print_vector(vector<ll> & a) {
	forn(i, (ll)a.size()) {
		cout << a[i] << " ";
	}
	cout << "\n";
}
void read_vector(vector<ll> & a, ll n) {
	ll h;
	forn(i, n) {
		cin >> h;
		a.pb(h);
	}
}
bool check_four(int a){
  int sum = 0;
  while(a){
    sum += a % 10;
    a /= 10;
  }
  return sum % 4 == 0;
}
void upd_max(int & a, int b){
  a = max(a, b);
}
void upd_min(int & a, int b){
  a = min(a, b);
}
//#define DEBUG
int main(){
	//FastIO;
	#ifdef DEBUG
		freopen("input.txt", "r", stdin);
	#endif // DEBUG
	int n;
	cin >> n;
	map<int, int> used_x;
	map<int, int> used_y;
	vector<pair<int, int> > gg;
	forn(i, 4 * n + 1){
		int x, y;
		cin >> x >> y;
		gg.pb({x, y});
		used_x[x]++;
		used_y[y]++;
	}
	sort(gg.begin(), gg.end());
	if (used_x[gg[0].fr] <= 1 || used_y[gg[0].sc] <= 1){
		cout << gg[0].fr << " " << gg[0].sc;
		return 0;
	}
	if (used_x[gg[4 * n].fr] <= 1 || used_y[gg[4 * n].sc] <= 1){
		cout << gg[4 * n].fr << " " << gg[4 * n].sc;
		return 0;
	}
	int x1 = gg[0].fr, x2 = gg[4 * n].fr, y1 = gg[0].sc, y2 = gg[4 * n].sc;
	int cnt = 0;
	for (int i = 0; i < 4 * n + 1; ++i){
		if (((gg[i].fr == x1 || gg[i].fr == x2) && gg[i].sc >= y1 && gg[i].sc <= y2) || ((gg[i].sc == y1 || gg[i].sc == y2) && gg[i].fr >= x1 && gg[i].fr <= x2)){
		}
		else{
			++cnt;
		}
	}
	//cout << cnt << " ";
	if (cnt == 1){
		for (int i = 0; i < 4 * n + 1; ++i){
			if (((gg[i].fr == x1 || gg[i].fr == x2) && gg[i].sc >= y1 && gg[i].sc <= y2) || ((gg[i].sc == y1 || gg[i].sc == y2) && gg[i].fr >= x1 && gg[i].fr <= x2)){
			}
			else{
				cout << gg[i].fr << " " << gg[i].sc;
				return 0;
			}
		}
	}
	cnt = 0;
	x1 = gg[1].fr, y1 = gg[1].sc;
	for (int i = 0; i < 4 * n + 1; ++i){
		if (((gg[i].fr == x1 || gg[i].fr == x2) && gg[i].sc >= y1 && gg[i].sc <= y2) || ((gg[i].sc == y1 || gg[i].sc == y2) && gg[i].fr >= x1 && gg[i].fr <= x2)){
		}
		else{
			++cnt;
		}
	}
	if (cnt == 1){
		for (int i = 0; i < 4 * n + 1; ++i){
			if (((gg[i].fr == x1 || gg[i].fr == x2) && gg[i].sc >= y1 && gg[i].sc <= y2) || ((gg[i].sc == y1 || gg[i].sc == y2) && gg[i].fr >= x1 && gg[i].fr <= x2)){
			}
			else{
				cout << gg[i].fr << " " << gg[i].sc;
				return 0;
			}
		}
	}
	cout << gg[4 * n].fr << " " << gg[4 * n].sc;
  return 0;
}

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <tchar.h>
//#include <intrin.h>

#define LL long long
#define MOD 1000000007
#define INF 2000000000
#define LINF 9000000000000000000

using namespace std;

const int N = 4e5 + 10;
pair<int, int>p[N];
int n;

pair<pair<int,int>,int> check(int x,int y) {

	int ret = 0;
	pair<int, int>p1;

	for (int i = 0;i < 4 * n + 1;i++) {

		if (i == x || i == y)
			continue;

		if ((p[i].first == p[x].first || p[i].first == p[y].first) && p[i].second >= p[x].second&&p[i].second <= p[y].second)
			continue;
		if ((p[i].second == p[x].second || p[i].second == p[y].second) && p[i].first >= p[x].first&&p[i].first <= p[y].first)
			continue;

		ret++;
		p1 = p[i];
	}
	return{ p1,ret };
}

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

	for (int i = 0;i < 4 * n + 1;i++)
		scanf("%d%d", &p[i].first, &p[i].second);

	sort(p, p + 4 * n + 1);
	pair<int, int>ans;

	pair<pair<int,int>, int>p1 = check(0, 4 * n);
	if (p1.second == 1) ans = p1.first;
	p1 = check(1, 4 * n);
	if (p1.second == 1) ans = p1.first;
	p1 = check(0, 4 * n - 1);
	if (p1.second == 1) ans = p1.first;

	printf("%d %d\n", ans.first, ans.second);
}

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

int n;
pair<int,int>p[1004];

double INF = 1e100;
double EPS = 1e-12;

struct PT {
    double x, y;

    PT() {
    }

    PT(double x, double y) : x(x), y(y) {
    }

    PT(const PT &p) : x(p.x), y(p.y) {
    }

    PT operator+(const PT &p) const {
        return PT(x + p.x, y + p.y);
    }

    PT operator-(const PT &p) const {
        return PT(x - p.x, y - p.y);
    }

    PT operator*(double c) const {
        return PT(x*c, y * c);
    }

    PT operator/(double c) const {
        return PT(x / c, y / c);
    }
};

double dot(PT p, PT q) {
    return p.x * q.x + p.y * q.y;
}

double dist2(PT p, PT q) {
    return dot(p - q, p - q);
}
PT ProjectPointSegment(PT a, PT b, PT c) {
    double r = dot(b - a, b - a);
    if (fabs(r) < EPS) return a;
    r = dot(c - a, b - a) / r;
    if (r < 0) return a;
    if (r > 1) return b;
    return a + (b - a) * r;
}
bool PointOnPolygon(const vector<PT> &p, PT q) {
    for (int i = 0; i < p.size(); i++)
        if (dist2(ProjectPointSegment(p[i], p[(i + 1) % p.size()], q), q) < EPS)
            return true;
    return false;
}
int main()
{
    ios::sync_with_stdio(0),cin.tie();
    cin >> n;
    int mx = 0 ,my = 0,nx = 100,ny = 100;
    map<int,int>xx,yy;
    for(int i=0; i<n*4+1; i++)
    {
        cin >> p[i].first >> p[i].second;
        xx[p[i].first]++;
        yy[p[i].second]++;
    }
    for(int i=0; i<n*4+1; i++)
    {
        if(xx[p[i].first] > 1)
        {
            mx = max(p[i].first , mx);
            nx = min(p[i].first , nx);
        }
        if(yy[p[i].second] > 1)
        {
            my = max(p[i].second , my);
            ny = min(p[i].second , ny);
        }
    }
    vector<PT>v;
    v.push_back(PT(nx , ny));
    v.push_back(PT(nx , my));
    v.push_back(PT(mx , my));
    v.push_back(PT(mx , ny));
    cout << nx << " " << mx << " " << ny << " " << my << endl;
    for(int i=0; i<n*4+1; i++)
    {
        if(!PointOnPolygon(v , PT(p[i].first , p[i].second)))
            return cout << p[i].first << " " << p[i].second,0;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
set<pair<int,int> >s;
multiset<int>v;
for(int i=0;i<4*n+1;i++){
        int x,y;
cin>>x>>y;
v.insert(x);v.insert(y);
    s.insert({x,y});
}
auto it1=s.begin();
auto it2=s.end();it2--;
if(it2->first-it1->first==it2->second-it1->second){
for(auto it=s.begin();it!=s.end();it++){
    if((it->first < it1->first) || (it->first > it2->first) || (it->second < it1->second) || (it->second > it2->second) || (it->first > it1->first && it->first < it2->first && it->second > it1->second && it->second < it2->second)){
        cout<<it->first<<" "<<it->second;return 0;
    }
}
}
else{
        auto i=s.begin();
        if(v.count(i->first)==1 || v.count(i->second)==1)cout<<i->first<<" "<<i->second;
        else {
            auto k=s.end();k--;
            cout<<k->first<<" "<<k->second;
        }
}
return 0;
}

#include <bits/stdc++.h>
#define N 60
using namespace std;
int book[N][N]={};
vector<pair<int,int> > s;
int main(){
	bool flag;
	int n,x[N],y[N],i,j,k,l,m,vd,num,tx,ty,ux,uy,a=0,b=0;
	cin>>n;
	for(i=0;i<4*n+1;i++)
	{
		cin>>x[i]>>y[i];
		s.push_back(make_pair(x[i],y[i]));
	}
	sort(s.begin(),s.end());
	for(i=1;i<s.size();i++)
	{
		a=max(a,s[i].first-s[0].first);
		b=max(b,s[i].second-s[0].second);
	}
	vd=n;
	i=s[0].first;
	j=s[0].second;
	for(;n<=10;n++)
	{
		for(k=-50;k<=50;k++)
		{
			for(l=-50;l<=50;l++)
			{
				memset(book,0,sizeof(book));
				flag=true;
				book[i][j]=1;
				tx=i;
				ty=j;
				ux=k;
				uy=l;
				for(m=0;m<n;m++)
				{
					tx=tx+ux;
					ty=ty+uy;
					if(tx>50||ty>50||tx<0||ty<0)
					{
						m=-1;
						break;
					}
					book[tx][ty]=1;
				}//NO.1
				if(m==-1)
				{
					continue;
				}
				ux=l;
				uy=-k;
				for(m=0;m<n;m++)
				{
					tx=tx+ux;
					ty=ty+uy;
					if(tx>50||ty>50||tx<0||ty<0)
					{
						m=-1;
						break;
					}
					book[tx][ty]=1;
				}//NO.2
				if(m==-1)
				{
					continue;
				}
				ux=-k;
				uy=-l;
				for(m=0;m<n;m++)
				{
					tx=tx+ux;
					ty=ty+uy;
					if(tx>50||ty>50||tx<0||ty<0)
					{
						m=-1;
						break;
					}
					book[tx][ty]=1;
				}//NO.3
				if(m==-1)
				{
					continue;
				}
				ux=-l;
				uy=k;
				for(m=0;m<n;m++)
				{
					tx=tx+ux;
					ty=ty+uy;
					if(tx>50||ty>50||tx<0||ty<0)
					{
						m=-1;
						break;
					}
					book[tx][ty]=1;
				}//NO.4
				if(m==-1)
				{
					continue;
				}
				num=0;
				for(m=0;m<4*vd+1;m++)
				{
					if(!book[x[m]][y[m]])
					{
						num++;
						tx=x[m];
						ty=y[m];
						if(num>=2)
						{
							break;
						}
					}
				}
				if(num==1)
				{
					cout<<tx<<" "<<ty<<endl;
					return 0;
				}
			}
		}
	}
	cout<<i<<" "<<j<<endl;
	return 0;
}

// nlather (Nishant Raj Lather)
// Chrollo_Lucifer

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rnd(x, y) uniform_int_distribution<ll>(x, y)(rng)
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define boost ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define rep(i, x, n) for(ll i = x; i < n; i++)
#define rrep(i, x, n) for(ll i = x; i >= n; i--)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define e emplace
#define mp make_pair
#define debug(this) cout<<"> "<<#this<<" : "<<this<<"\n"
typedef long long int ll;
typedef long double ld;
typedef pair< ll, ll > pii;
typedef vector< ll > vi;
typedef vector< vi > vvi;
const ll MOD = 1e9+7;
ld PI=3.1415926535897932384626;
ld EPS = 1e-9;
#define endl '\n'

int main() {
	boost;
	ll n, x, y;
	cin >> n;
	ll mx = -1, my = -1, mnx = 100, mny = 100;
	vector<pii> cord;
	map<ll, ll> x_cord, y_cord;
	rep(i, 0, (4*n+1)) {
		cin >> x >> y;
		cord.eb(x, y);
		if(++y_cord[y] > 1) my = max(my, y), mny = min(mny, y);
		if(++x_cord[x] > 1) mnx = min(mnx, x), mx = max(mx, x);
	}
	for(pii &p : cord) {
		if(x_cord[p.ff] == 1 or y_cord[p.ss] == 1 or (p.ff != mnx and p.ff != mx and p.ss != mny and p.ss != my)) {
			cout << p.ff << " " << p.ss << endl;
			return 0;
		}
	}
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>
#include <stack>
#include <cmath>
#include <string>
#include <deque>
#include <map>
#include <iomanip>
#include <math.h>
#include <cstdlib>
#include <stdlib.h>
#include <set>
#include <unordered_set>
#include <cassert>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
#define FastIO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < n; ++i)
#define pb push_back
#define fr first
#define sc second
typedef long long ll;
typedef long double ld;
const ll p = 997;
const ll base = 1e9 + 7;
const ll MAXN = 5e5;
const ll INF = 1e9;
const ll MOD = 1e9;
const double PII = 3.14159265358979323846264338327950288419716939937510;
const double Epsilon = 1.19209e-9;
const ld fi = 1.6180339887498948482;
const ll one = 2147483647;
const ll two = 1e9 + 7;
void print_vector(vector<ll> & a) {
	forn(i, (ll)a.size()) {
		cout << a[i] << " ";
	}
	cout << "\n";
}
void read_vector(vector<ll> & a, ll n) {
	ll h;
	forn(i, n) {
		cin >> h;
		a.pb(h);
	}
}
bool check_four(int a){
  int sum = 0;
  while(a){
    sum += a % 10;
    a /= 10;
  }
  return sum % 4 == 0;
}
void upd_max(int & a, int b){
  a = max(a, b);
}
void upd_min(int & a, int b){
  a = min(a, b);
}
//#define DEBUG
int main(){
	//FastIO;
	#ifdef DEBUG
		freopen("input.txt", "r", stdin);
	#endif // DEBUG
	int n;
	cin >> n;
	map<int, int> used_x;
	map<int, int> used_y;
	vector<pair<int, int> > gg;
	forn(i, 4 * n + 1){
		int x, y;
		cin >> x >> y;
		gg.pb({x, y});
		used_x[x]++;
		used_y[y]++;
	}
	for (int i = 0; i < 4 * n + 1; ++i){
		if (used_x[gg[i].fr] == 1 || used_y[gg[i].sc] == 1){
			cout << gg[i].fr << " " << gg[i].sc;
			return 0;
		}
	}
	sort(gg.begin(), gg.end());
	int x1 = gg[0].fr, x2 = gg[4 * n].fr, y1 = gg[0].sc, y2 = gg[4 * n].sc;
	for (int i = 0; i < 4 * n + 1; ++i){
		if (gg[i].fr != x1 && gg[i].fr != x2 && gg[i].sc != y1 && gg[i].sc != y2){
			cout << gg[i].fr << " " << gg[i].sc;
			return 0;
		}
	}
  return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define N 30009
using namespace std;
int n,mat[109][109],tr[109][109];
void t(int x,int y)
{

    int sum=n;
    if(mat[x+sum][y]&&mat[x][y+sum]&&mat[x+sum][y+sum])
    {
        for(int i=x;i<=x+sum;i++)
        {tr[i][y]=1;tr[i][y+sum]=1;}
        for(int i=y;i<=y+sum;i++)
        {tr[x][i]=1;tr[x+sum][i]=1;}
        for(int i=0;i<59;i++)
        {
            for(int j=0;j<59;j++)
            {
                if(mat[i][j]&&tr[i][j]==0)
                {
                    cout<<i<<" "<<j;
                    exit(0);
                }
            }
        }
    }
    else
    {
        cout<<x<<" "<<y;
        exit(0);
    }
}
int x,y;
int main()
{
    cin>>n;
    for(int i=0;i<=4*n;i++)
    {
        cin>>x>>y;
        mat[x][y]=1;
    }
    for(int i=0;i<59;i++)
    {
        for(int j=0;j<59;j++)if(mat[i][j])t(i,j);
    }
}

#include<bits/stdc++.h>
#define int long long
#define y1 asdas
using namespace std;
const int N=70;
int n,x1,y1,x2,y2;
vector<set<int>>vx(N);
vector<pair<int,int>>v;
bool check(){
	for(int i=0;i<N;++i){
		if(vx[i].size()>1){
			x1=i;
			y1=*vx[i].begin();
			break;
		}
	}
	for(int i=N-1;i>=0;--i){
		if(vx[i].size()>1){
			x2=i;
			y2=*(--vx[i].end());
			break;
		}
	}
	if(x1==x2)return 0;
	if(vx[x1].find(y2)==vx[x1].end())return 0;
	if(vx[x2].find(y1)==vx[x2].end())return 0;
	if(x2-x1!=y2-y1)return 0;
	for(int i=0;i<N;++i){
		for(auto&y:vx[i]){
			int x=i;
			if(x<x1||x>x2||y>y2||y<y1||(x>x1&&x<x2&&y>y1&&y<y2))
				return 0;
		}
	}
	return 1;
}
signed main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#endif
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=0;i<4*n+1;++i){
		int x,y;
		cin>>x>>y;
		vx[x].insert(y);
		v.push_back({x,y});
	}
	for(auto&p:v){
		int x=p.first,y=p.second;
		vx[x].erase(y);
		if(check()){
			cout<<x<<' '<<y;
			return 0;
		}
		vx[x].insert(y);
	}
}

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
set<pair<int,int> >s;
for(int i=0;i<4*n+1;i++){
        int x,y;
cin>>x>>y;
    s.insert({x,y});
}
set<pair<int,int> >::iterator it1=s.begin();
set<pair<int,int> >::iterator it2=s.end();it2--;
if(it2->first-it1->first==it2->second-it1->second){
for(set<pair<int,int> >::iterator it=s.begin();it!=s.end();it++){
    if((it->first < it1->first) || (it->first > it2->first) || (it->second < it1->second) || (it->second > it2->second) || ((it->first > it1->first && it->first < it2->first)&&(it->second > it1->second && it->second < it2->second))){
        cout<<it->first<<" "<<it->second;return 0;
    }
}
}
else{
        set<pair<int,int> >::iterator ans=s.begin();
        ans++;
    if(it2->first-ans->first==it2->second-ans->second){
    cout<<it1->first<<" "<<it1->second;}
    else{
        cout<<it2->first<<" "<<it2->second;
    }
}
return 0;
}

#include<stdio.h>
#include<utility>
#define pii pair<int,int>
#include<vector>
using namespace std;
int X[55],Y[55];
main()
{
    int n;
    scanf("%d",&n);
    pii A[4*n+15];
    int xtemp,ytemp,xmax=0,ymax=0;
    for(int i=0;i<4*n+1;i++)
    {
        scanf("%d %d",&xtemp,&ytemp);
        X[xtemp]++;
        Y[ytemp]++;
        if(xtemp > xmax)
            xmax = xtemp;
        if(ytemp > ymax)
            ymax = ytemp;
        A[i] = make_pair(xtemp,ytemp);
    }
    int xleft,ytop;
    for(int i=0;i<=xmax;i++)
    {
        if(X[i] >= n+1)
        {
            xleft = i;
            break;
        }

    }
    for(int i=0;i<=ymax;i++)
    {
        if(Y[i] >= n+1)
        {
            ytop = i;
            break;
        }
    }
    int xright = xleft + n;
    int ybot = ytop + n;
    //printf("%d %d %d %d",xleft,xright,ytop,ybot);
    for(int i=0;i<4*n+1;i++)
    {
        xtemp = A[i].first;
        ytemp = A[i].second;
        if(xleft !=xtemp && xright != xtemp && ytemp !=ytop && ytemp !=ybot)
        {
            printf("%d %d",xtemp,ytemp);
            return 0;
        }
        else if((xleft == xtemp||xright == xtemp) && (ytemp <ytop || ytemp > ybot))
        {
            printf("%d %d",xtemp,ytemp);
            return 0;
        }
        else if((ytop == ytemp||ybot == ytemp) && (xtemp < xleft || xtemp > xright))
        {
            printf("%d %d",xtemp,ytemp);
            return 0;
        }
    }
    while(true)
    {

    }
}

#include <bits/stdc++.h>
#define ll long long
#define N 200009
using namespace std;
int n,mat[1009][1009];
vector<pair<int,int> >v;
void sqr(int x,int y)
{
    for(int k=2;k<=50;k++)
    {
        int ans=0;
        for(int i=x;i<x+k;i++)
        {
            ans+=mat[i][y];
            ans+=mat[i][y+k-1];
            if(mat[i][y])v.push_back({i,y});
            mat[i][y]=0;
            if( mat[i][y+k-1])v.push_back({i,y+k-1});
            mat[i][y+k-1]=0;
        }
        for(int i=y;i<y+k;i++)
        {
            ans+=mat[x][i];
            ans+=mat[x+k-1][i];
            if(mat[x][i])v.push_back({x,i});
            if(mat[x+k-1][i])v.push_back({x+k-1,i});
            mat[x][i]=0;
            mat[x+k-1][i]=0;
        }
        if(ans==4*n)
        {
            for(int i=0;i<59;i++)
            {
                for(int j=0;j<58;j++)
                {
                    if(mat[i][j])
                    {
                        cout<<i<<" "<<j;
                        exit(0);
                    }
                }
            }
        }
        else
        {
            while(v.size())
            {
                mat[v.back().first][v.back().second]=1;
                v.pop_back();
            }
        }
    }
}
int main()
{
    cin>>n;
    int x,y;
    for(int i=0;i<4*n+1;i++)
    {
        cin>>x>>y;
        mat[x][y]=1;
    }
    for(int i=0;i<59;i++)
    {
        for(int j=0;j<58;j++)
        {
            sqr(i,j);
        }
    }
}

/* ****_hela**** */

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

#define N  100005

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int TESTS=1;
//    cin>>TESTS;
    while(TESTS--)
    {
        int n;cin>>n;
        vector< pair<int,int> >v;
        int a[51]={0},b[51]={0};
        for(int i=0;i<4*n+1;i++)
        {
            int x,y;
            cin>>x>>y;
            v.pb(mp(x,y));
            a[x]++;b[y]++;
        }
        int x1,x2,y1,y2;
        for(int i=0;i<51;i++)
            if(a[i]>=n+1)
        {
            x1=i;break;
        }
        for(int i=0;i<51;i++)
            if(b[i]>=n+1)
        {
            y1=i;break;
        }
        for(int i=50;i>=0;i--)
            if(a[i]>=n+1)
        {
            x2=i;break;
        }
                for(int i=50;i>=0;i--)
            if(b[i]>=n+1)
        {
            y2=i;break;
        }
        //cout<<x1<<" "<<x2<<" "<<y1<<" "<<y2;cout<<'\n';
        for(int i=0;i<4*n+1;i++)
        {
            int x=v[i].F,y=v[i].S;
            if(x<x1||x>x2)
            {
                cout<<v[i].F<<" "<<v[i].S;
                return 0;
            }
            if(y<y1||y>y2)
            {
                cout<<v[i].F<<" "<<v[i].S;
                return 0;
            }
            if(x>x1&&x<x2&&y<y2&&y>y1)
            {
                cout<<x<<" "<<y;
                return 0;
            }
        }

    }
    return 0;
}

//                                      KiSmAt
#include "bits/stdc++.h"
using namespace std;

using ll = long long;

const ll inf = 1e18;
const int N = 2 * 1e5 + 10;

ll res;
ll a[N];

vector<pair<ll, ll> > v, vv;

bool foo(ll x, ll y, ll xx, ll yy){
    for(auto i: vv){
        if(i.first == x && y <= i.second && i.second <= yy)   continue;
        if(i.first == xx && y <= i.second && i.second <= yy)   continue;
        if(x <= i.first && i.first <= xx && i.second == y)   continue;
        if(x <= i.first && i.first <= xx && i.second == yy)   continue;
        return 0;
    }
    return 1;
}

void solve(){
    ll n, x, y, mx = inf, mi = inf;
    cin >> n;
    n = 4 * n + 1;
    for(int i = 0; i < n; ++i){
        cin >> x >> y;
        v.push_back({x, y});
    }
    for(int i = 0; i < v.size(); ++i){
        ll mx = inf, my = inf, mxx = -inf, myy = -inf;
        vv.clear();
        for(int j = 0; j < v.size(); ++j){
            if(i != j)  vv.push_back(v[j]);
        }
        for(auto j: vv){
            mx = min(mx, j.first);
            mxx = max(mxx, j.first);
            my = min(my, j.second);
            myy = max(myy, j.second);
        }
        if(foo(mx, my, mxx, myy)){
            cout << v[i].first << " " << v[i].second << "\n";
            return ;
        }
    }
}

int main(int argc, char const *argv[]){
    ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    ll t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}
// nEro

// Hacheylight
#include <map>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <string>
#include <numeric>
#include <cstring>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std ;
//#define int long long
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define loop(it, v) for (auto it = v.begin(); it != v.end(); it++)
#define cont(i, x) for (int i = head[x]; i; i = e[i].nxt)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, sum) memset(a, sum, sizeof(a))
#define lowbit(x) (x & -x)
#define all(x) x.begin(), x.end()
#define SC(t, x) static_cast <t> (x)
#define ub upper_bound
#define lb lower_bound
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define pof pop_front
#define pob pop_back
#define fi first
#define se second
#define y1 y1_
#define Pi acos(-1.0)
#define iv inline void
#define enter cout << endl
#define siz(x) ((int)x.size())
#define file(x) freopen(x".in", "r", stdin),freopen(x".out", "w", stdout)
typedef double db ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair <int, int> pii ;
typedef vector <int> vi ;
typedef vector <pii> vii ;
typedef queue <int> qi ;
typedef queue <pii> qii ;
typedef set <int> si ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int N = 100010 ;
const int INF = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = 2e18 ;
const int MOD = 1000000007 ;
const double eps = 1e-7 ;
void douout(double x){ printf("%lf\n", x + 0.0000000001) ; }
template <class T> void print(T a) { cout << a << endl ; exit(0) ; }
template <class T> void chmin(T &a, T b) { if (a > b) a = b ; }
template <class T> void chmax(T &a, T b) { if (a < b) a = b ; }
template <class T> void add(T &a, T b) { a = (1ll * a + b) % MOD ; }
template <class T> void sub(T &a, T b) { a = (a - b + MOD) % MOD ; }
template <class T> void mul(T &a, T b) { a = (ll) a * b % MOD ; }
template <class T> T read() {
    int f = 1 ; T x = 0 ;
    char ch = getchar() ;
    while (!isdigit(ch)) { if (ch == '-') f = -1 ; ch = getchar() ; }
    while (isdigit(ch)) { x = x * 10 + ch -'0' ; ch = getchar() ; }
    return x * f ;
}

int n ;
int a[N], b[N] ;
map <pii, int> hsh ;
vector <pii> v ;
int mix = iinf, miy = iinf ;

signed main() {
	scanf("%d", &n) ;
	rep(i, 1, 4 * n + 1) scanf("%d%d", &a[i], &b[i]) ;
	rep(i, 1, 4 * n + 1) chmin(mix, a[i]), chmin(miy, b[i]) ;
	rep(i, 1, 4 * n + 1) a[i] -= mix, b[i] -= miy ;
	rep(i, 0, n) hsh[mp(0, i)] = 1, hsh[mp(n, i)] = 1 ;
	rep(i, 0, n) hsh[mp(i, 0)] = 1, hsh[mp(i, n)] = 1 ;
	rep(i, 1, 4 * n + 1)
	if (hsh.find(mp(a[i], b[i])) == hsh.end()) {
		v.pb(mp(a[i] + mix, b[i] + miy)) ;
	}
	if (siz(v) == 1) {
		cout << v[0].fi << " " << v[0].se << endl ;
		return 0 ;
	}
	rep(i, 1, 4 * n + 1)
	if (a[i] == mix && b[i] == miy) {
		cout << a[i] << " " << b[i] << endl ;
		return 0 ;
	}
//	mix = iinf, miy = iinf ;
//	rep(i, 1, 4 * n + 1) a[i] -= mix, b[i] -= miy ;
//	rep(i, 0, n) hsh[mp(0, i)] = 1, hsh[mp(n, i)] = 1 ;
//	rep(i, 0, n) hsh[mp(i, 0)] = 1, hsh[mp(i, n)] = 1 ;
//	rep(i, 1, 4 * n + 1) {
//		if (a[i] == iinf && a[j] == iinf) continue ;
//		if (hsh.find(mp(a[i], b[i])) == hsh.end()) {
//			cout << a[i] + mix << " " << b[i] + miy << endl ;
//			return ;
//		}
}

/*
写代码时请注意：
	1.ll？数组大小，边界？数据范围？
	2.精度？
	3.特判？
	4.至少做一些
思考提醒：
	1.最大值最小->二分？
	2.可以贪心么？不行dp可以么
	3.可以优化么
	4.维护区间用什么数据结构？
	5.统计方案是用dp？模了么？
	6.逆向思维？
*/

#include<bits/stdc++.h>

using namespace std;
#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) REP(i,0,(int)a-1)
#define FORD(i,a) REV(i,(int)a-1,0)
#define PB push_back
#define POB pop_back
#define MP make_pair
#define FI first
#define SE second
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int , int > pii;
typedef vector < int > vi;
typedef vector < pii > vii;

const ll MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int INF = 1e9;

ll addMod(ll a, ll b){
	if(a + b >= MOD) return a + b - MOD;
	return a + b;
}

ll mulMod(ll a, ll b){
	return (a * b) % MOD;
}

ll fast(ll a, ll b){
	if(b == 0) return 1;
	ll tmp = fast(a, b/2);
	tmp = mulMod(tmp, tmp);
	if(b & 1) tmp = mulMod(tmp, a);
	return tmp;
}

//////////////////////////////////////////////////////

const int N = 105;

struct point{
	int x,y;
	point(int _x = -1, int _y = -1) : x(_x), y(_y){};
}p[N + 5];

bool vis[N + 5][N + 5];
int n;

bool check(int x1, int x2, int y1, int y2){
	int cnt = 0;
	REP(i,x1,x2){
		if(vis[i][y1]) cnt++;
		if(vis[i][y2]) cnt++;
	}
	REP(i,y1,y2){
		if(vis[x1][i]) cnt++;
		if(vis[x2][i]) cnt++;
	}
	if(vis[x1][y1]) cnt--;
	if(vis[x1][y2]) cnt--;
	if(vis[x2][y1]) cnt--;
	if(vis[x2][y2]) cnt--;
	return cnt == 4*n;
}

point solve(){
	int x1, x2, y1, y2;
	FOR(i,4*n+1){
		memset(vis,0,sizeof vis);
		x1 = y1 = INF;
		x2 = y2 = -INF;
		FOR(j,4*n+1){
			if(i == j) continue;
			vis[p[j].x][p[j].y] = true;
			x1 = min(x1, p[j].x);
			x2 = max(x2, p[j].x);
			y1 = min(y1, p[j].y);
			y2 = max(y2, p[j].y);
		}
		if(check(x1,x2,y1,y2)){
			return p[i];
		}
	}
	return point(-1,-1);
}

int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	FOR(i,4*n+1){
		cin >> p[i].x >> p[i].y;
	}
	point ans = solve();
	cout << ans.x << " " << ans.y << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
struct pos{
	int x,y;
};
int n;
pos s[80];
struct node{
	bool b[105][105];
};
node f[105];
void print(node v){
	for(int i=1;i<=20;i++){
		for(int j=1;j<=20;j++){
			cout<<v.b[i][j];
		}
		cout<<endl;
	}
}
void make_up(int x){
	memset(f[x].b,0,sizeof(f[x].b));
	for(int i=1;i<=x;i++){
		f[x].b[1][i]=1;
		f[x].b[i][1]=1;
		f[x].b[x][i]=1;
		f[x].b[i][x]=1;
	}
}
bool pipei(int x,node v){
	for(int i=1;i<=62;i++){
		for(int j=1;j<=62;j++){
			if(v.b[i][j]!=f[x].b[i][j]) return 0;
		}
	}
	return 1;
}
int main(){
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		cin>>s[i].x>>s[i].y;
		s[i].x++,s[i].y++;
	}
	for(int i=1;i<=60;i++){
		make_up(i);
	}
	for(int i=1;i<=4*n+1;i++){
		//no i
		node x;
		memset(x.b,0,sizeof(x.b));
		int ux=1000,uy=1000;
		for(int j=1;j<=4*n+1;j++){
			if(i==j) continue;
			ux=min(ux,s[j].x);
			uy=min(uy,s[j].y);
		}
		for(int j=1;j<=4*n+1;j++){
			if(i==j) continue;
			x.b[s[j].x-ux+1][s[j].y-uy+1]=1;
		}
		bool flag=0;
		for(int k=1;k<=60;k++){
			if(pipei(k,x)){
				flag=1;break;
			}
		}
		if(flag){
			cout<<s[i].x-1<<" "<<s[i].y-1<<endl;
			return 0;
		}
	}
	return 0;
}

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//* vamsicool007    You are never wrong to do the right thing    vamsicool007 *
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include<bits/stdc++.h>
using namespace std;
#define flash ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define int long long
typedef long long ll;
typedef long double ld;
const int mod = 1000000007;
const int N=200005;
vector<int>vis(N);
vector<vector<int>>adj(N);
void dfs(int v){vis[v]=1;for(auto i:adj[v]){if(!vis[i]){dfs(i);}}return;}
bool isPrime(ll n){if(n<2)return false;for(ll i=2;i*i<=n;++i){if(n%i==0){return false;}}return true;}
ll factorial(ll n){return (n==1 || n==0) ? 1:n*factorial(n-1);}
ll power(ll x,ll y){ll res=1;x=x;while(y>0){if(y&1)res=(res*x)%mod;y=y>>1;x=(x*x)%mod;}return res%mod;}
ll gcd(ll a,ll b){if (a==0)return b;return gcd(b%a,a);}
ll lcm(ll a,ll b){return (a/gcd(a,b)*b);}
ll max(ll a,ll b){ll ans=a>b?a:b;return ans;}
ll min(ll a,ll b){ll ans=a<b?a:b;return ans;}
int root(int a[],int i){while(a[i]!=i){a[i]=a[a[i]];i=a[i];}return i;}
void unionn(int a[],int i,int j){int root_i=root(a,i);int root_j=root(a,j);a[root_i]=root_j;return;}
void fun()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

signed main()
{
    flash;
    fun();
    int tt=1;
    //cin>>tt;
    while(tt--)
    {
        int n;
        cin>>n;
        int a[51][51]={};

        int minx=55,maxx=-1,miny=55,maxy=-1;
        for(int i=0;i<4*n+1;i++)
        {
            int x,y;
            cin>>x>>y;
            a[x][y]=1;
            maxx=max(x,maxx);
            minx=min(x,minx);
            maxy=max(y,maxy);
            miny=min(y,miny);
        }
        //cout<<maxx<<minx<<maxy<<miny;
        for(int i=minx;i<=maxx;i++)
        {
            int c=0,k;
            for(int j=miny;j<=maxy;j++)
            {
                if(a[i][j])
                    {c++;k=j;}
            }
            if(c==1)
                {cout<<i<<" "<<k;return 0;}
        }

        for(int i=miny;i<=maxy;i++)
        {
            int c=0,k;
            for(int j=minx;j<=maxx;j++)
            {
                if(a[j][i])
                    {c++;k=j;}
            }
            if(c==1)
                {cout<<k<<" "<<i;return 0;}
        }

        for(int i=minx+1;i<maxx;i++)
        {
            for(int j=miny+1;j<maxy;j++)
            {
                if(a[i][j]==1)
                    return cout<<i<<" "<<j,0;
            }
        }
    }
    return 0;
}

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

#define     ll      long long
#define     inf     100000000000000
#define     MAX     3000007
#define     MOD     1000000007
#define     pii     pair<int,int>
#define     eps     1e-6
#define     FIN     freopen("input.txt","r",stdin);
#define     FOUT    freopen("output.txt","w",stdout);

int main ()
{

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

    int n;
    cin>>n;

    vector<pii> v;
    int a,b;

    for(int i=0;i<(4*n+1);i++)
    {

        cin>>a>>b;

        v.push_back({a,b});
    }

    for(int i=0;i<v.size();i++)
    {
        int xMin=51,xMax=-1,yMin=51,yMax=-1,xx,yy;

        for(int j=0;j<v.size();j++)
        {

            if(j!=i)
            {
                xx = v[j].first;
                yy = v[j].second;

                xMin = min(xx,xMin);
                yMin = min(yy,yMin);
                xMax = max(xx,xMax);
                yMax = max(yy,yMax);
            }
        }

//        cout<<xMin<<" "<<xMax<<" "<<yMin<<" "<<yMax<<endl;

        xx = v[i].first;
        yy = v[i].second;
        if( xMax-xMin == yMax-yMin && xx<xMin || xx>xMax || yy<yMin || yy>yMax || (xx>xMin && xx<xMax && yy>yMin && yy <yMax))
        {
            cout<<v[i].first<<" "<<v[i].second<<endl;
            return 0;
        }
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
using namespace std;
typedef unsigned long long ULL;
typedef long long LL;
const LL maxn = 1e5;

struct Point{
    int x,y;
}p[50];

void out(int n) {
    for(int i = 0; i < n; i++)
        printf("%d,%d\n",p[i].x, p[i].y);
}

int main() {
    int n;cin>>n; n = n*4+1;
    Point MIN; MIN.x = 100, MIN.y = 100;
    for(int i = 0; i<n; i++) {
        cin >> p[i].x >> p[i].y;
        if(p[i].x <= MIN.x && p[i].y <= MIN.y)
            MIN = p[i];
    }

    Point sec; sec.x = 100, sec.y = 100;
    for(int i = 0; i < n; i++) {
        Point k = p[i];
        if(k.x == MIN.x && k.y == MIN.y) continue;
        if(k.x <= sec.x && k.y <= sec.y)
            sec = p[i];
    }

    int a = 0, x = MIN.x, y = MIN.y, cnt = 0;
    for(int i = 0; i < n; i++) {
        p[i].x -= x, p[i].y -= y;
        a = max(a, p[i].x);
    }
    //out(n);
    Point ans;
    for(int i = 0; i < n; i++) {
        Point k = p[i];
        int X = k.x, Y = k.y;
        if(X==0 && Y>=0 && Y<=a)
            continue;
        else if(Y==0 && X>=0 && X<=a)
            continue;
        else if(X==a && Y>=0 && Y<=a)
            continue;
        else if(Y==a && X>=0 && X<=a)
            continue;
        else {
            cnt++;
            ans.x = X+x, ans.y = Y+y;
        }
    }
    if(cnt == 1) {printf("%d %d\n",ans.x, ans.y); return 0;}
    for(int i = 0; i < n; i++)
        p[i].x += x, p[i].y += y;
    a = 0, x = sec.x, y = sec.y, cnt = 0;
    for(int i = 0; i < n; i++) {
        p[i].x -= x, p[i].y -= y;
        a = max(a, p[i].x);
    }
    for(int i = 0; i < n; i++) {
        Point k = p[i];
        int X = k.x, Y = k.y;
        if(X==0 && Y>=0 && Y<=a)
            continue;
        else if(Y==0 && X>=0 && X<=a)
            continue;
        else if(X==a && Y>=0 && Y<=a)
            continue;
        else if(Y==a && X>=0 && X<=a)
            continue;
        else {
            cnt++;
            ans.x = X+x, ans.y = Y+y;
        }
    }
    printf("%d %d\n",ans.x, ans.y);
	return 0;
}

#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define inf 1000000000
#define md 1000000007
#define pb push_back
#define li 100005
#define lo long long
using namespace std;
int n,x[105],y[105],mn=inf,mx,tp[105][105];
int tut=inf,tut2;
int say;
pair<int,int> p[105];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=4*n+1;i++){
		scanf("%d %d",&x[i],&y[i]);
		tp[x[i]][y[i]]=1;
	}
	for(int i=0;i<=50;i++){
		for(int j=0;j<=50;j++){
			say=0;
			for(int h=1;h<=4*n+1;h++) tp[x[h]][y[h]]=1;
			if(tp[i][j]==1) {say++;tp[i][j]=2;}
			int z=j;
			for(int q=1;q<=n;q++){
				z++;
				if(tp[i][z]==1) {say++;tp[i][z]=2;}
			}
			int g=i;
			for(int q=1;q<=n;q++){
				g++;
				if(tp[g][z]==1) {say++;tp[g][z]=2;}
			}
			for(int q=1;q<=n;q++){
				z--;
				if(tp[g][z]==1) {say++;tp[g][z]=2;}
			}
			for(int q=1;q<=n-1;q++){
				g--;
				if(tp[g][z]==1) {say++;tp[g][z]=2;}
			}
			if(say==4*n){
				for(int h=1;h<=4*n+1;h++){
					if(tp[x[h]][y[h]]==1){
						printf("%d %d\n",x[h],y[h]);
						return 0;
					}
				}
			}
		}
	}
	return 0;
}

/*
我的心脏怦怦跳，监管者就在附近
*/
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#include<string>
#include<iostream>
#include<cmath>
#include<set>
#include<stack>
#include<queue>
#include<unistd.h>
#include<stdio.h>
#include<cstring>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
bool prime(int x){
	 int i;
	 if(x<2) return 0;
	 for(i=2;i*i<=x;i++){
		if(x%i==0){return 0;}
	 }
	 return 1;
}
int a,b,c,d;
int main()
{
	int n;
	cin>>n;
	int i,k=0;
	for(i=0;i<n*4+1;i++){
		cin>>a>>b;
		if(a<0||a>n||b<0||b>n) {
			c=a;
			d=b;
		}
	}
	cout<<c<<" "<<d<<endl;
	return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define ll long long
#define el '\n'

using namespace std;

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

    int n;
    cin >> n;

    int len=4*n+1;
    pii ar[len+2];

    for (int i=0;i<len;i++){
        cin >> ar[i].fi >> ar[i].se;
    }

    sort(ar,ar+len);

    for (int hilang=0;hilang<len;hilang++){
        vector <pii> v;
        int cnt=0,xmin=MOD,xmax=-MOD,ymin=MOD,ymax=-MOD;
        for (int i=0;i<len;i++){
            if (i==hilang) continue;
            v.pb(ar[i]);
            xmin=min(xmin,ar[i].fi);
            xmax=max(xmax,ar[i].fi);
            ymin=min(ymin,ar[i].se);
            ymax=max(ymax,ar[i].se);
        }

        for (auto coor : v){
            if (coor.fi==xmin || coor.fi==xmax){
                if (coor.se>=ymin && coor.se<=ymax) continue;
            }

            if (coor.se==ymin || coor.se==ymax){
                if (coor.fi>=xmin && coor.fi<=xmax) continue;
            }

            cnt++;
        }

        if (cnt==0){
            cout << ar[hilang].fi << " " << ar[hilang].se << el;
            return 0;
        }

    }

    return 0;
}

#include<stdio.h>

int main(){
    printf("0 0\n");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
int n;
pair<int,int> point[100];
bool vis[60][60],v2[60][60];
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		cin>>point[i].first>>point[i].second;
		vis[point[i].first][point[i].second]=true;
	}
	for(int i=1;i<=50;i++){//SIZE
		for(int j=0;j<=50;j++){
			for(int k=0;k<=50;k++){//左上
				memset(v2,0,sizeof(v2));
				for(int l=0;l<i;l++){//上
					v2[j][k+l]=true;
				}
				for(int l=0;l<i;l++){//左
					v2[j+l][k]=true;
				}
				for(int l=0;l<i;l++){//下
					v2[j+i-1][k+l]=true;
				}
				for(int l=0;l<i;l++){//右
					v2[j+l][k+i-1]=true;
				}
				int cnt=0;
				pair<int,int> pos;
				for(int l=1;l<=4*n+1;l++){
					if(!v2[point[l].first][point[l].second]){
						cnt++;
						pos=point[l];
					}
				}
				if(cnt==1){
					cout<<pos.first<<' '<<pos.second<<endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int N=100;
int n,x[N],y[N],numx[N],numy[N],maxx,minx=100,maxy,miny=100,a[N],tp;bool flag=0,visx[N],visy[N];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n*4+1;i++){
		scanf("%d%d",&x[i],&y[i]);
		numx[x[i]]++;numy[y[i]]++;
	}
	for(int i=1;i<=n*4+1;i++)if(numx[x[i]]>=n&&numy[y[i]]>=n){
		maxx=max(maxx,x[i]);
		minx=min(minx,x[i]);
		maxy=max(maxy,y[i]);
		miny=min(miny,y[i]);
	}
	for(int i=1;i<=n*4+1;i++)if(x[i]>maxx||x[i]<minx||y[i]>maxy||y[i]<miny)printf("%d %d\n",x[i],y[i]),flag=1;
	if(!flag)for(int i=1;i<=n*4+1;i++)if(x[i]!=maxx&&x[i]!=minx&&y[i]!=maxy&&y[i]!=miny)printf("%d %d\n",x[i],y[i]);
	return 0;
}

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

main() {
  ios::sync_with_stdio(false), cin.tie(0);

  int t = 1, n, m, i, j, k, l, u, to;
  // cin >> t;
  // int tc = t;
  while (t--) {
    // cout << "Case #" << tc - t << ": ";
    cin >> n;
    k = 55;
    vector<int> x(k), y(k);
    vector<pair<int, int>> a(4 * n + 1);
    for(auto &it: a) {
      cin >> it.first >> it.second;
      x[it.first]++, y[it.second]++;
    }
    int mnx = k, mxx = 0, mny = k, mxy = 0;
    for(i = 0; i < k; i++) {
      if(x[i] >= 2) {
        mnx = min(mnx, i);
        mxx = max(mxx, i);
      }
      if(y[i] >= 2) {
        mny = min(mny, i);
        mxy = max(mxy, i);
      }
    }
    int ansx, ansy;
    for(auto &it: a) {
      int xx = it.first, yy = it.second;
      if(xx != mnx && xx != mxx) {
        ansx = xx;
      }
      if(yy != mny && yy != mxy) {
        ansy = yy;
      }
    }
    cout << ansx << ' ' << ansy;
  }
}

		/*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

//ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;}

#define pb push_back
#define eb emplace_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007

double PI=3.1415926535897932384626;

//template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

#define bip(n) __builtin_popcount(n)//no of ones bit in binary!!
#define bictz(n) __builtin_ctz(n)//no of trailing zeroes in binary!!
#define biclz(n) __builtin_clz(n)//no of leading zeroes in binary!!
#define bffs(n) __builtin_ffs(n)//index of first one bit!!

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;

//#define fi1 ifstream cin("input.txt")
//#define of1 ofstream cout("output.txt")
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;

#define fi first
#define se second

//fn to check if c lies on square with left lower corner as a and right upper as b

bool check(pair<ll,ll>&a,pair<ll,ll>&b,pair<ll,ll>&c)
{
    if(c.fi==a.fi && (c.se>=a.se && c.se<=b.se))
        return true;
    if(c.fi==b.fi && (c.se>=a.se && c.se<=b.se))
        return true;
    if(c.se==a.se && (c.fi>=a.fi && c.fi<=b.fi))
        return true;
    if(c.se==b.se && (c.fi>=a.fi && c.fi<=b.fi))
        return true;
    return false;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin>>n;
	vector< pair<ll,ll> >points;
	for(ll u=0;u<(4*n+1);u++)
	{
		ll x,y;
		cin>>x>>y;
		points.eb(x,y);
	}
	sort(points.begin(),points.end());
	ll ax=-1,ay=-1;
	for(ll i=0;i<(4*n+1);i++)
	{
		for(ll j=i+1;j<(4*n+1);j++)
		{
			if((points[i].fi==points[j].fi) || (points[i].se==points[j].se))
			{
				continue;
			}
			ll c=0;
			for(ll k=0;k<(4*n+1);k++)
			{
				if((k==i) || (k==j))
					continue;
				if(!check(points[i],points[j],points[k]))
				{
					ax=points[k].fi;
					ay=points[k].se;
					c++;
				}
				if(c>1)
				    break;
			}
			if(c==1)
			{
				cout<<ax<<" "<<ay<<endl;
				return 0;
			}
		}
	}
    return 0;
}

/**************************************************************
    Problem: ????
    User: Big_Red_Dates
    Language: GNU_C++11
    Result: Accepted
    Time:0 ms
    Memory:0 kb
    length:0 kb
    score: inf
****************************************************************/
//CLOCKS_PER_SEC
using namespace std;
#include<bitset>
#include<deque>
#include<stdint.h>
#include<set>
#include<stack>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<cstring>
#include<ctime>
#include<map>
#define sqr(x) (x)*(x)
//#define sort stable_sort
#define ll long long
#define mk make_pair
#define pb push_back
#define in insert
#define mtr(x,y,z) mk(mk(x,y),z)
#define fi first
#define se second
#define lch(x) ((x)<<1)
#define rch(x) (((x)<<1)|1)
#define all(x) (x).begin(),(x).end()
#define titose CLOCKS_PER_SEC
#define fpi(x) freopen(x,"r",stdin);
#define fpo(x) freopen(x,"w",stdout);
#define fprio fpi("in.txt");fpo("out.txt");
#define fast ios_base::sync_with_stdio(false);
inline void read(int &x){int v=0,f=1;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void read(ll &x){ll v=0ll,f=1ll;char c=getchar();while (!isdigit(c)&&c!='-') c=getchar();if (c=='-') f=-1; else v=(c&15);while (isdigit(c=getchar())) v=(v<<1)+(v<<3)+(c&15);x=v*f;}
inline void readc(char &x){char c;while ((c=getchar())==' ');x=c;}
inline void writes(string s){puts(s.c_str());}
inline void writeln(){writes("");}
inline void writei(int x){if (x<0){putchar('-');x=abs(x);}if (!x) putchar('0');char a[25];int top=0;while (x){a[++top]=(x%10)+'0';x/=10;}while (top){putchar(a[top]);top--;}}
inline void writell(ll x){if (x<0){putchar('-');x=abs(x);}if (!x) putchar('0');char a[25];int top=0;while (x){a[++top]=(x%10)+'0';x/=10;}while (top){putchar(a[top]);top--;}}
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define si set<int>
#define sl set<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define msi map<string,int>
#define msl map<string,ll>
#define piii pair<int,pii >
#define piipi pair<pii,int>
#define plll pair<ll,pll >
#define pllpl pair<pll,ll>
#define pqi priority_queue<int>
#define pql priority_queue<ll>
#define npqi priority_queue<int,vector<int>,greater<int> >
#define npql priority_queue<ll,vector<ll>,greater<ll> >
#define forup(i,a,b) for ((i)=(a);(i)<=(b);(i)++)
#define fordo(i,a,b) for ((i)=(a);(i)>=(b);(i)--)
#define rep(i,x) forup ((i),1,(x))
#define repd(i,x) fordo ((i),(x),1)
#define itr iterator
#define fe(itcalc,c) for(__typeof((c).begin()) itcalc=(c).begin();itcalc!=(c).end();itcalc++)
#define NO {cout<<"NO";return 0;}
#define YES {cout<<"YES";return 0;}
#define y0 y000000000000000000000000000
#define y1 y111111111111111111111111111
#define j0 j000000000000000000000000000
#define j1 j111111111111111111111111111
#define cl0(a) memset((a),(0),(sizeof((a))))
#define clz(a) memset((a),(0x16),(sizeof((a))))
#define clf(a) memset((a),(-(0x16)),(sizeof((a))))
#define inf 0x3bbbbbbb
#define lnf 0x1bbbbbbbbbbbbbbbll
#define sqrt divi
#define p2(i) (1ll<<(i))
#define readi read
#define readll read
/*************************************************/
int n,m,i,j,a[55],b[55],s1,s2;
bool check(int x){
	int i,mix=inf,mxx=-inf,miy=inf,mxy=-inf;
	int c1=0,c2=0,c3=0,c4=0;
	rep(i,n+n+n+n+1)if(i!=x){
		mix=min(mix,a[i]);
		mxx=max(mxx,a[i]);
		miy=min(miy,b[i]);
		mxy=max(mxy,b[i]);
	}
	rep(i,n+n+n+n+1)if(i!=x){
		if(a[i]==mix&&miy<=b[i]&&b[i]<mxy){c1++;continue;}
		if(a[i]==mxx&&miy<b[i]&&b[i]<=mxy){c2++;continue;}
		if(b[i]==miy&&mix<a[i]&&a[i]<=mxx){c3++;continue;}
		if(b[i]==mxy&&mix<=a[i]&&a[i]<mxx){c4++;continue;}
		return 0;
	}
	return c1==n&&c2==n&&c3==n&&c4==n;
}
bool check2(int x){
	int i,mix=inf,mxx=-inf,miy=inf,mxy=-inf;
	int c1=0,c2=0,c3=0,c4=0;
	rep(i,n+n+n+n+1)if(i!=x){
		mix=min(mix,a[i]);
		mxx=max(mxx,a[i]);
		miy=min(miy,b[i]);
		mxy=max(mxy,b[i]);
	}
	rep(i,n+n+n+n+1)if(i!=x){
		if(a[i]==mix&&miy<b[i]&&b[i]<=mxy){c1++;continue;}
		if(a[i]==mxx&&miy<=b[i]&&b[i]<mxy){c2++;continue;}
		if(b[i]==miy&&mix<=a[i]&&a[i]<mxx){c3++;continue;}
		if(b[i]==mxy&&mix<a[i]&&a[i]<=mxx){c4++;continue;}
		return 0;
	}
	return c1==n&&c2==n&&c3==n&&c4==n;
}
int main(){
	read(n);
	rep(i,n+n+n+n+1){
		read(a[i]);read(b[i]);
	}
	rep(i,n+n+n+n+1)if(check(i)||check2(i)){
		printf("%d %d\n",a[i],b[i]);
		return 0;
	}
	return 0;
}

#include <bits/stdc++.h>

#define F first
#define S second
#define MP make_pair
#define PB push_back

using namespace std;

typedef long long ll;
typedef long double ld;

const int max_n = 55, inf = 1000111222;

vector<pair<int, int>> v;

bool check(int bad) {
    pair<int, int> dl = {200, 200}, ur = {-1, -1};
    for (int i = 0; i < v.size(); ++i) {
        if (i == bad) continue;
        dl.F = min(dl.F, v[i].F);
        dl.S = min(dl.S, v[i].S);

        ur.F = max(ur.F, v[i].F);
        ur.S = max(ur.S, v[i].S);
    }
    for (int i = 0; i < v.size(); ++i) {
        pair<int, int> p = v[i];
        if (i == bad) {
            if (p.F == dl.F && p.S >= dl.S && p.S <= ur.S) return false;
            if (p.F == ur.F && p.S >= dl.S && p.S <= ur.S) return false;
            if (p.S == dl.S && p.F >= dl.F && p.F <= ur.F) return false;
            if (p.S == ur.S && p.F >= dl.F && p.F <= ur.F) return false;
            continue;
        }
        if (p.F == dl.F && p.S >= dl.S && p.S <= ur.S) continue;
        if (p.F == ur.F && p.S >= dl.S && p.S <= ur.S) continue;
        if (p.S == dl.S && p.F >= dl.F && p.F <= ur.F) continue;
        if (p.S == ur.S && p.F >= dl.F && p.F <= ur.F) continue;
        return false;
    }
    return true;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    n = 4 * n + 1;
    for (int i = 0; i < n; ++i) {
        int a, b;
        cin >> a >> b;
        v.emplace_back(a, b);
    }
    for (int i = 0; i < n; ++i) {
        pair<int, int> bad = v[i];
        if (check(i)) {
            cout << bad.F << ' ' << bad.S << endl;
            return 0;
        }
    }
    exit(228);
    return 0;
}

#include <bits/stdc++.h>

#define MAX 1e9
#define fi first
#define se second
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
using namespace std;
#define fir(i,a,b) for(i=a;i<=b;i++)
#define fer(i,a,b) for(i=a;i>=b;i--)

vector<vector<int>> row(51);
vector<vector<int>> col(51);
queue<pair<int,int>> crd;

int main(){
    int n=0;
    cin>>n;
    int x=0,y=0;
    int mar=0,mir=1e9,mac=0,mic=1e9;
    for(int i=n*4+1;i>0;i--){
        cin>>x>>y;
        row[x].push_back(y);
        col[y].push_back(x);
        crd.push({x,y});
    }
    for(int i=0;i<51;i++){
        if(row[i].size()>=n){
            mar=max(mar,i);
            mir=min(mir,i);
        }
        if(col[i].size()>=n){
            mac=max(mac,i);
            mic=min(mic,i);
        }
    }
    while((crd.front().fi==mar || crd.front().fi==mir) || (crd.front().se==mac || crd.front().se==mic))
        crd.pop();
    cout<<crd.front().fi<<" "<<crd.front().se<<endl;
    return 0;
}

#include <sstream>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<ctime>
#include<cmath>
#include<map>
#include<stack>
#include<random>
#include<queue>
#include<list>
#include<math.h>
#include<bitset>
#include<fstream>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < int(n); i++)
const ll INF=9223372036854775807;
const ll mod=1000000007;
int  MOD(int  a, int  b)
{
    if(a>b)
        return a-b;
    else
        return b-a;
}
ll  max3(ll  a,ll  b, ll  c)
{
    return max(c,max(a,b));
}
ll min3(ll  a,ll  b,ll  c)
{
    return min(a,min(b,c));
}
ll  power(ll  x,ll  y,ll mod1)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%mod1;
        y = y>>1;
        x = (x*x)%mod1;
    }
    return res;
}
ll logg(ll  a)
{
    ll  x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
}
ll  gcd(ll  a,ll   b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll abso(ll x)
{
    if(x<0)
    {
        return -x;
    }
    return x;
}
ll ceiling (ll  a,ll  b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
ll modinv(ll x,ll p)
{
    return power(x,p-2,p);
}
int main()
{
    int n;
    cin>>n;
    vector<int> x(4*n+1),y(4*n+1);vvi grid(51);
    for(int i=0;i<=50;i++)
    {
        grid[i].resize(51);
    }
    for(int i=0;i<4*n+1;i++)
    {
        cin>>x[i]>>y[i];
        grid[x[i]][y[i]]++;
    }
    for(int i=0;i<4*n+1;i++){
        grid[x[i]][y[i]]--;
        bool c=true;
    for(int i=0;i<=50;i++)
    {
        for(int j=0;j<=50;j++)
        {
            if(grid[i][j]==1)
            {
                int l=0;int r=0;int d=0;int u=0;
                for(int k=0;k<=50;k++)
                {
                    if(j>k&&grid[i][k]==1)
                    {
                        l++;
                        break;
                    }
                }
                for(int k=0;k<=50;k++)
                {
                    if(j<k&&grid[i][k]==1)
                    {
                        r++;
                        break;
                    }
                }
                for(int k=0;k<=50;k++)
                {
                    if(i>k&&grid[k][j]==1)
                    {
                        d++;
                        break;
                    }
                }
                for(int k=0;k<=50;k++)
                {
                    if(i<k&&grid[k][j]==1)
                    {
                        u++;
                        break;
                    }
                }
                if(l+r+d+u==0||l+r+d+u==4||l+r+d+u==1)
                {
                    c=false;
                }

            }
        }
    }
        if(c)
        {
            cout<<x[i]<<' '<<y[i]<<endl;;
            return 0;
        }
    }
}

#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
int n,m;
pii a[50];
int grid[51][51];
int ones[41];
inline pii check(int x1,int y1,int x2,int y2){
    int cnt=0;
    pii ans;
    memset(ones,0,sizeof(ones));
    for(int i=x1;i<=x2;i++) ones[grid[i][y1]]=1;
    for(int i=y1;i<=y2;i++) ones[grid[x1][i]]=1;
    for(int i=x1;i<=x2;i++) ones[grid[i][y2]]=1;
    for(int i=y1;i<=y2;i++) ones[grid[x2][i]]=1;
    for(int i=1;i<=m;i++)
        if(ones[i]!=1)
            if(!cnt){
                cnt++;
                ans=a[i-1];
            }
            else
                return mp(-1,-1);
    //cout<<x1<<" "<<y1<<" "<<x2<<" "<<y2<<endl;
    return ans;
}
int main(){
    cin>>n;m=4*n+1;
    for(int i=0;i<m;i++)
        cin>>a[i].fi>>a[i].se;
    //sort(a,a+n);
    for(int i=0;i<m;i++)
        grid[a[i].fi][a[i].se]=i+1;
    bool ok=0;
    for(int i=0;i<=50 && !ok;i++)
        for(int j=0;j<=50 && !ok;j++)
            for(int k=i;k+i<=50 && k+j<=50 && !ok;k++){
                    pii x=check(i,j,k+i,k+j);
                    if(x.fi!=-1){
                        cout<<x.fi<<" "<<x.se<<endl;
                        ok=1;
                    }
                }
    return 0;
}

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

#define     ll      long long
#define     inf     100000000000000
#define     MAX     3000007
#define     MOD     1000000007
#define     pii     pair<int,int>
#define     eps     1e-6
#define     FIN     freopen("input.txt","r",stdin);
#define     FOUT    freopen("output.txt","w",stdout);

int main ()
{

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

    int n;
    cin>>n;

    vector<pii> v;
    int a,b;

    for(int i=0;i<(4*n+1);i++)
    {

        cin>>a>>b;

        v.push_back({a,b});
    }

    for(int i=0;i<v.size();i++)
    {
        int xMin=51,xMax=-1,yMin=51,yMax=-1,xx,yy;

        for(int j=0;j<v.size();j++)
        {

            if(j!=i)
            {
                xx = v[j].first;
                yy = v[j].second;

                xMin = min(xx,xMin);
                yMin = min(yy,yMin);
                xMax = max(xx,xMax);
                yMax = max(yy,yMax);
            }
        }

//        cout<<xMin<<" "<<xMax<<" "<<yMin<<" "<<yMax<<endl;

        if(xMax-xMin == yMax-yMin)
            continue;

        bool flag = true;

        for(int j=0;j<v.size();j++)
        {

            if(j!=i)
            {
                xx = v[j].first;
                yy = v[j].second;

                if(xx> xMin && xx<xMax && yy>yMin && yy<yMax)
                    flag = false;
            }
        }

        xx = v[i].first;
        yy = v[i].second;

        if(xx>=xMin && xx<=xMax && yy>=yMin && yy<=yMax)
            if(!(xx>xMin && xx<xMax && yy>yMin && yy<yMax))
                flag = false;

        if( flag )
        {
            cout<<v[i].first<<" "<<v[i].second<<endl;
            return 0;
        }
    }
    return 0;
}

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

int main() {
	// your code goes here'
	int n;
	cin>>n;
	int x[52]={0};int y[52]={0};
	int a[52],b[52];
	for(int i=0;i<4*n+1;i++){
		cin>>a[i]>>b[i];
	}int minx=10005;int miny=10005;int maxx=-1;int maxy=-1;
	for(int i=0;i<4*n+1;i++){
		x[a[i]]++;y[b[i]]++;
		if(minx>a[i]){
			minx=a[i];
		}if(maxx<a[i]){
			maxx=a[i];
		}
		if(miny>b[i]){
			miny=b[i];
		}if(maxy<b[i]){
			maxy=b[i];
		}
	}int j;
	for(int i=0;i<4*n+1;i++){
		  if(x[a[i]]==3&&y[b[i]]==3&&minx!=a[i]&&maxx!=a[i]&&miny!=b[i]&&maxy!=b[i]){
			cout<<a[i]<<" "<<b[i]<<endl;break;
		}
		else if(x[a[i]]==n+1&&y[b[i]]==1){
			cout<<a[i]<<" "<<b[i]<<endl;break;
		}else if(y[b[i]]==n+1&&x[a[i]]==1){
			cout<<a[i]<<" "<<b[i]<<endl;break;
		}
	}
	 return 0;
}

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

int r[55], c[55];

int main() {
	int n, x, y;
	int maxr = -1, maxc = -1;
	int minr = 55, minc = 55;
	cin >> n;
	for(int i = 0; i < 4*n+1; i++) {
		cin >> x >> y;
		minr = min(x, minr);
		maxr = max(x, maxr);
		r[x]++;
		minc = min(y, minc);
		maxc = max(y, maxc);
		c[y]++;
	}
	if(r[minr] != n+1) cout << minr << " ";
	else if(r[maxr] != n+1) cout << maxr << " ";
	else {
		for(int i = minr+1; i < maxr; i++)
			if(r[i] != 2) {
				cout << i << " ";
				break;
			}
	}
	if(c[minc] != n+1) cout << minc;
	else if(c[maxc] != n+1) cout << maxc;
	else {
		for(int i = minc+1; i < maxc; i++)
			if(c[i] != 2) {
				cout << i;
				break;
			}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int x[4*n+1],y[4*n+1],cnt_x[51]={0},cnt_y[51]={0};
    for(int i=0;i<4*n+1;i++)
    {
        cin>>x[i]>>y[i];
        cnt_x[x[i]]++,cnt_y[y[i]]++;
    }
    int mnx=51,mny=51,mxx=-1,mxy=-1;
    for(int i=0;i<=50;i++)
    {
        if(cnt_x[i]>1)
        {
            mnx=min(mnx,i);
            mxx=max(mxx,i);
        }
        if(cnt_y[i]>1)
        {
            mny=min(mny,i);
            mxy=max(mxy,i);
        }
    }
    set<pair<int,int> > s1,s2,s3,s4;
    for(int i=0;i<=n;i++)
    {
        s1.insert(make_pair(i,mny));
        s2.insert(make_pair(mnx,i));
        s3.insert(make_pair(mxx,i));
        s4.insert(make_pair(i,mxy));
    }
    pair<int,int> ans;
    for(int i=0;i<4*n+1;i++)
    {
        if(!s1.count(make_pair(x[i],y[i]))&&!s2.count(make_pair(x[i],y[i]))&&!s3.count(make_pair(x[i],y[i]))&&!s4.count(make_pair(x[i],y[i])))
        {
            ans=make_pair(x[i],y[i]);
        }
    }
    cout<<ans.first<<" "<<ans.second;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
set<pair<int,int> >s;
for(int i=0;i<4*n+1;i++){
        int x,y;
cin>>x>>y;
    s.insert({x,y});
}
set<pair<int,int> >::iterator it1=s.begin();
set<pair<int,int> >::iterator it2=s.end();it2--;
if(it2->first-it1->first==it2->second-it1->second){
for(set<pair<int,int> >::iterator it=s.begin();it!=s.end();it++){
    if((it->first < it1->first) || (it->first > it2->first) || (it->second < it1->second) || (it->second > it2->second) || ((it->first > it1->first && it->first < it2->first)&&(it->second > it1->second && it->second < it2->second))){
        cout<<it->first<<" "<<it->second;return 0;
    }
}
}
else{
        set<pair<int,int> >::iterator ans=s.begin();
        ans++;
    if(it2->first-ans->first==it2->second-ans->second){
    cout<<it1->first<<" "<<it1->second;}
    else{
        cout<<it2->first<<" "<<it2->second;
    }
}
return 0;
}

#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
#pragma GCC target("popcnt")
#include <bits/stdc++.h>
#define maxn 400010
#define ll long long
#define ull unsigned long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define pii pair<int, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define IL inline
#define ss system
using namespace std;

struct point {
  int x, y;
  bool operator < (const point &rhs) const {
    return x == rhs.x ? y < rhs.y : x < rhs.x;
  }
} ps[maxn];
int n;
template <class T> void read(T &x) {
  char ch = x = 0;
  bool fl = false;
  while (!isdigit(ch))
    fl |= ch == '-', ch = getchar();
  while (isdigit(ch))
    x = x * 10 + ch - '0', ch = getchar();
  x = fl ? -x : x;
}
bool check(int x) {
  vector<point> vec;
  for (int i = 1; i < x; i++) {
    vec.pb(ps[i]);
  }
  for (int i = x + 1; i <= n; i++) {
    vec.pb(ps[i]);
  }
  sort(vec.begin(), vec.end());
  int a = vec[0].x, b = vec[0].y, c = vec.back().x, d = vec.back().y;
  if (c - a != d - b)
    return false;
  int ca = 0, cb = 0, cc = 0, cd = 0;
  for (int i = 0; i < vec.size(); i++) {
    if (vec[i].x != a && vec[i].x != c && vec[i].y != b && vec[i].y != d)
      return false;
    ca += vec[i].x == a, cb += vec[i].y == b, cc += vec[i].x == c, cd += vec[i].y == d;
    if (vec[i].x < a || vec[i].x > c || vec[i].y < b || vec[i].y > d)
      return false;
  }
  return ca >= n / 4 && cb >= n / 4 && cc >= n / 4 && cd >= n / 4;
}
int main() {
  cin >> n, n = 4 * n + 1;
  for (int i = 1; i <= n; i++) {
    cin >> ps[i].x >> ps[i].y;
  }
  for (int i = 1; i <= n; i++) {
    if (check(i))
      return cout << ps[i].x << " " << ps[i].y << endl, 0;
  }
  return 0;
}

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

int x[41],y[41],present[55][55];

int main()
{
    memset(present,0,sizeof present);
    int n,m,a,b,cnt;
    cin>>n;
    m=4*n+1;

    for(int i=0;i<m;i++)
    {
        scanf("%d %d",&x[i],&y[i]);
        present[ x[i] ][ y[i] ]=1;
    }

    for(int i=0; i<m; i++)
    {
        cnt=0;
        a = x[i] , b = y[i]-1;
        if(a>=0 && b>=0)cnt+= present[a][b];
        a = x[i] , b = y[i]+1;
        if(a>=0 && b>=0)cnt+= present[a][b];
        a = x[i]-1 , b = y[i];
        if(a>=0 && b>=0)cnt+= present[a][b];
        a = x[i]+1 , b = y[i];
        if(a>=0 && b>=0)cnt+= present[a][b];

        if(!(cnt>1 && cnt<4))
        {
            printf("%d %d",x[i],y[i]);
            break;
        }

    }
    return 0;
}

#include <bits/stdc++.h>

#define F first
#define S second
#define MP make_pair
#define PB push_back

using namespace std;

typedef long long ll;
typedef long double ld;

const int max_n = 55, inf = 1000111222;

vector<pair<int, int>> v;

bool check(int bad) {
    pair<int, int> dl = {200, 200}, ur = {-1, -1};
    for (int i = 0; i < v.size(); ++i) {
        if (i == bad) continue;
        dl.F = min(dl.F, v[i].F);
        dl.S = min(dl.S, v[i].S);

        ur.F = max(ur.F, v[i].F);
        ur.S = max(ur.S, v[i].S);
    }
    for (int i = 0; i < v.size(); ++i) {
        pair<int, int> p = v[i];
        if (i == bad) continue;
        if (p.F == dl.F && p.S >= dl.S && p.S <= ur.S) continue;
        if (p.F == ur.F && p.S >= dl.S && p.S <= ur.S) continue;
        if (p.S == dl.S && p.F >= dl.F && p.F <= ur.F) continue;
        if (p.S == ur.S && p.F >= dl.F && p.F <= ur.F) continue;
        return false;
    }
    return true;
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    n = 4 * n + 1;
    for (int i = 0; i < n; ++i) {
        int a, b;
        cin >> a >> b;
        v.emplace_back(a, b);
    }
    for (int i = 0; i < n; ++i) {
        pair<int, int> bad = v[i];
        if (check(i)) {
            cout << bad.F << ' ' << bad.S << endl;
            return 0;
        }
    }
    exit(228);
    return 0;
}

#include <bits/stdc++.h>
#define INF 1000000000 + 20
#define MOD 1000000007
#define EPS 1e-10
#define m_p make_pair
#define f first
#define TASK "dfs"
#define s second
#define sz(x) (x).size()
#define all(x) (x).begin(), (x).end()
#define forn for(int i = 0; i < n; i++)
#define fori(x, y) for(ll i = (x); i < (y); i++)
#define forj(x, y) for(ll j = (x); j < (y); j++)
#define form for(int i = 0; i < m; i++)
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef vector<vi> vvi;

ll pow1(ll x, ll n) {
    if(n==0)
        return 1;
    if(n==1)
        return x;
    if(n % 2 == 0)
        return pow1(x * x, n / 2);
  	return pow1(x * x, n / 2) * x;
}

ll powm(ll x, ll n) {
    if(n==0)
        return 1;
    if(n==1)
        return x;
    if(n % 2 == 0)
        return powm(x * x % MOD, n / 2);
  	return (powm(x * x % MOD, n / 2) * x) % MOD;
}

ll gcd (ll a, ll b) {
	if(a > b)
		swap(a, b);
	if (a == 0) {
		return b;
	}
	return gcd (b % a, a);
}

void fastIO() {
	ios_base::sync_with_stdio(0);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#else
	 //   freopen(TASK".in", "r", stdin);
	//	freopen(TASK".out", "w", stdout);
		#define cerr if(0) cerr
	#endif
}

void db() {cerr << endl;}
void db(auto x) {cerr << x << endl;}
void db(auto x, auto y) {cerr << x << ' ' << y << endl;}
void db(auto x, auto y, auto z) {cerr << x << ' ' << y << ' ' << z << endl;}
void db(auto x, auto y, auto z, auto e) {cerr << x << ' ' << y << ' ' << z << ' ' << e << endl;}
void db(auto x, auto y, auto z, auto e, auto w) {cerr << x << ' ' << y << ' ' << z << ' ' << e << ' ' << w << endl;}
void db(auto x, auto y, auto z, auto e, auto w, auto r) {cerr << x << ' ' << y << ' ' << z << ' ' << e << ' ' << w << ' ' << r << endl;}
void db(auto x, auto y, auto z, auto e, auto w, auto r, auto t) {cerr << x << ' ' << y << ' ' << z << ' ' << e << ' ' << w << ' ' << r << ' ' << t << endl;}

const int MAXN = 1e3 + 11;

ll n, x, y, k, a[MAXN][MAXN], was[MAXN];
pii c[MAXN];

int main() {
	fastIO();

	cin >> n;
	n = n * 4 + 1;
	fori(1, n + 1) {
		cin >> x >> y;
		a[x][y] = i;
		c[i] = {x, y};
	}

	fori(0, 50) {
		forj(0, 50) {
			for(int q = 2; q <= 50; q++) {
				k = 0;
				fill(was, was + n, 0);
				for(int t = 0; t < q - 1; t++) {
					if(a[i][j + t]) {
						was[a[i][j + t]]++;
						k++;
					}
					if(a[i + t][j]) {
						was[a[i + t][j]]++;
						k++;
					}
					if(a[i + q - 1][j + t]) {
						was[a[i + q - 1][j + t]]++;
						k++;
					}
					if(a[i + t][j + q - 1]) {
						was[a[i + t][j + q - 1]]++;
						k++;
					}
				}
				if(i == 0 && j == 0 && q == 3)
					db(k);
				if(k == n - 1) {
					for(int t = 1; t <= n; t++) {
						if(!was[t]) {
							cout << c[t].f << ' ' << c[t].s;
							return 0;
						}
					}
				}
			}
		}
	}

	return 0;
}

#include <bits/stdc++.h>

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define ll long long
#define el '\n'

using namespace std;

bool cekx[51],ceky[51];

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

    int n;
    cin >> n;
    int len=4*n+1;

    pii ar[len];
    vector <int> vxx,vyy;
    for (int i=0;i<len;i++){
        cin >> ar[i].fi >> ar[i].se;
        if (!cekx[ar[i].fi]){
            vxx.pb(ar[i].fi);
            cekx[ar[i].fi]=1;
        }

        if (!ceky[ar[i].se]){
            vyy.pb(ar[i].se);
            ceky[ar[i].se]=1;
        }
    }

    vector <int> vx,vy;
    if (vxx.size()>=4){
        int tm=vxx.size();
        vx.pb(vxx[0]);vx.pb(vxx[1]);
        vx.pb(vxx[tm-1]);vx.pb(vxx[tm-2]);
    } else{
        for (auto x : vxx) vx.pb(x);
    }

    if (vyy.size()>=4){
        int tm=vyy.size();
        vy.pb(vyy[0]);vy.pb(vyy[1]);
        vy.pb(vyy[tm-1]);vy.pb(vyy[tm-2]);
    } else{
        for (auto x : vyy) vy.pb(x);
    }

    for (auto xa : vx){
        for (auto xb : vx){
            if (xb<=xa) continue;
            for (auto ya : vy){
                for (auto yb : vy){
                    if (yb<=ya) continue;
                    int cnt=0,id=-1,cx1=0,cx2=0,cy1=0,cy2=0;
                    for (int i=0;i<len;i++){
                        if (ar[i].fi==xa || ar[i].fi==xb){
                            if (ar[i].se>=ya && ar[i].se<=yb){
                                if (ar[i].fi==xa) cx1++;
                                if (ar[i].fi==xb) cx2++;
                                if (ar[i].se==ya) cy1++;
                                if (ar[i].se==yb) cy2++;
                                continue;
                            }
                        }
                        if (ar[i].se==ya || ar[i].se==yb){
                            if (ar[i].fi>=xa && ar[i].fi<=xb){
                                if (ar[i].fi==xa) cx1++;
                                if (ar[i].fi==xb) cx2++;
                                if (ar[i].se==ya) cy1++;
                                if (ar[i].se==yb) cy2++;
                                continue;
                            }
                        }

                        cnt++;id=i;
                    }

                    if (cnt==1 && (cx1>=n && cx2>=n && cy1>=n && cy2>=n)){
                    //    cerr << el;
                    //    cerr << xa << " " << xb << el;
                    //    cerr << ya << " " << yb << el;
                        cout << ar[id].fi << " " << ar[id].se << el;
                        return 0;
                    }
                }
            }
        }
    }

    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pi pair<int, int>
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define pl pair<ll, ll>
#define pd pair<double, double>
#define vp vector<pi>
#define f(i, n) for(int i = 0; i < n; i++)
#define fo(i, a, n) for(int i = a; i < n; i++)
#define INF 1<<30
#define mod (1000*1000*1000+7)
#define sz(x) int((x).size())

using namespace std;

bool check(pi &p, pi &pp, pi &pf){
    if((p.first == pp.first || p.first == pf.first) && (pp.second <= p.second && p.second <= pf.second)){
        return 1;
    }
    else if((p.second == pp.second || p.second == pf.second) && (pp.first <= p.first && p.first <= pf.first)){
        return 1;
    }
    return 0;
}

int main(int argc, char* argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    vp v;
    int n; cin >> n;
    f(i, 4*n+1){
        int a, b;
        cin >> a >> b;
        v.pb(mp(a, b));
    }

    f(i, 50){
        f(j, 50){
            fo(k, 1, min(51, min(51-j, 51-k))){
                int x = 0; pi p;
                f(m, sz(v)){
                    pi p1 = mp(i, j), p2 = mp(i+k, j+k);
                    if(!check(v[m], p1, p2)){
                        x++;
                        p = v[m];
                    }

                }
                if(x == 1){
                    cout << p.first << " " << p.second << endl;
                    return 0;
                }
            }
        }
    }

    return 0;
}

#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <vector>
#include <deque>
#include <string>
#include <map>
#include <stdio.h>
#include <cstdlib>
#include <iomanip>
using namespace std;
typedef long long int ll;
#define mod 1000000007LL
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    vector<vector<ll>> grid(51,vector<ll> (51,0));
    vector<pair<ll,ll>> a;
    int t1=4*n+1;
    while(t1--){
        int u,v;
        cin>>u>>v;
        a.push_back({u,v});
        grid[u][v]=1;
    }
    t1=4*n+1;
    for(int stx=0;stx<50;stx++){
        for(int enx=stx+1;enx<51;enx++){
            for(int sty=0;sty<50;sty++){
                for(int eny=sty+1;eny<51;eny++){
                    ll cnt=0;
                    for(int j=sty;j<=eny;j++){
                        if(grid[stx][j]==1){
                            cnt++;
                        }
                        if(grid[enx][j]==1){
                            cnt++;
                        }
                    }
                    for(int j=stx+1;j<=enx-1;j++){
                        if(grid[j][sty]==1){
                            cnt++;
                        }
                        if(grid[j][eny]==1){
                            cnt++;
                        }
                    }
                    if(cnt==4*n){
                        for(int i=0;i<a.size();i++){
                            if(a[i].first!=stx&&a[i].first!=enx&&a[i].second!=sty&&a[i].second!=eny){
                                cout<<a[i].first<<" "<<a[i].second;
                                return 0;
                            }
                        }
                    }
                }
            }
        }
    }
}

#include <bits/stdc++.h>

#define int long long

using namespace std ;

const int N=1e5*2;

pair <int,int > a[N] ;
set <  pair <int,int > > st ;
int n,c,x,y ;
main()
{
    cin >> n ;
    n*=4 ;
    n++ ;
       for (int i=1;i<=n;i++)
        cin >> a[i].first >> a[i].second ;

    for (int xx1=0; xx1<=50; xx1++)
        for (int xx2=0; xx2<=50; xx2++)
            for (int yy1=0; yy1+xx1<=50; yy1++)
            {
                int x1=min(xx1,xx2) ;
                int x2=max(xx1,xx2) ;
                int yy2=x2-x1+yy1 ;
                int y1=min(yy1,yy2) ;
                int y2=max(yy1,yy2) ;
                for (int i=1; i<=n; i++)
                {
                    x=a[i].first ;
                    y=a[i].second ;
                    if ((x==x1||x==x2)&&(y<=y2&&y>=y1))
                        continue ;
                    if ((y==y1||y==y2)&&(x<=x2&&x>=x1))
                        continue ;
                    st.insert({x,y}) ;
                }
                if (st.size()==1)
                {
                    for (auto ww : st)
                        cout <<  ww.first << " " << ww.second << endl ;
                    return 0 ;
                }
                st.clear() ;
            }
}

#include <bits/stdc++.h>

#define pb push_back
#define  mp make_pair
#define pp pop_back
#define pf push_front
#define fi first
#define se second
#define maxn 100005
#define mod 1000000007
typedef long long ll;
using namespace std;
#define pi pair<ll,ll >
#define debug_iv_ac ios::sync_with_stdio(false);cin.tie(NULL);

struct node{
    ll i,w,s;
    node(){}

    node(ll _i,ll _s){
        s = _s,i = _i;
    }

    bool operator < (node X)const{
        if(s!=X.s) return s < X.s;
        //if(pos!=X.pos) return X.pos<pos;
        return i < X.i;
    }
};

ll power(ll x, ll y, ll p)
{
    ll res = 1;      // Initialize result

    x = x % p;  // Update x if it is more than or
                // equal to p

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            res = (res*x) % p;

        // y must be even now
        y = y>>1; // y = y/2
        x = (x*x) % p;
    }
    return res;
}

ll add(ll a, ll b)
{
    a%=mod;b%=mod;
    return (a+b)%mod;
}

ll sub(ll a,ll b)
{
    a%=mod;b%=mod;
    return (a-b+mod)%mod;
}

ll prod(ll a,ll b)
{
    a%=mod;
    b%=mod;
    return (a*b)%mod;
}
const int MAXN = (1<<9);
int x1[maxn];
int y2[maxn];
int main()
{
	debug_iv_ac
	int n;
	cin>>n;
	int miny,minx,maxx,maxy;
	for(int i=1;i<=4*n+1;i++)
	{
	    int x,y;
	    cin>>x>>y;
	    x1[i] = x,y2[i] = y;
	    miny = min(miny,y);
	    maxy = max(maxy,y);
	    minx = min(minx,x);
	    maxx = max(maxx,x);
	}
	for(int i=minx;i<=maxx;i++)
	{
	    for(int j=miny;j<=maxy;j++)
	    {
	        for(int l=1;l<=50;l++)
	        {
	            int cnt = 0;
	            int x = 0,y = 0;
    	        for(int k=1;k<=4*n+1;k++)
    	        {
    	            if(x1[k]==i||x1[k]==i+l-1)
    	            {
    	                if(y2[k]<j||y2[k]>j+l-1)
    	                {
    	                    cnt++,x = x1[k],y = y2[k];
    	                }
    	            }
    	            else if(y2[k]==j||y2[k]==j+l-1)
    	            {
    	                if(x1[k]<i||x1[k]>i+l-1)
    	                {
    	                    cnt++,x = x1[k],y = y2[k];
    	                }
    	            }
    	            else cnt++,x = x1[k],y = y2[k];
    	            if(cnt>1) break;
    	        }
    	        if(cnt==1)
    	        {
    	            cout<<x<<" "<<y;return 0;
    	        }
	        }
	    }
	}
	return 0;
}

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<fstream>

using namespace std;

int n;

struct node
{
	int x,y;

	void init()
	{
		cin>>x>>y;
	}
} G[20];

int main()
{
//	freopen("r.txt","r",stdin);
	cin>>n;

	for (int i=1;i<=4*n+1;i++) G[i].init();

	for (int i=1;i<=4*n+1;i++)
	for (int j=1;j<=4*n+1;j++)
	if (i!=j and G[i].x==G[j].x)
	for (int k=1;k<=4*n+1;k++)
	if (i!=k and j!=k and G[i].y==G[k].y)
	for (int l=1;l<=4*n+1;l++)
	if (i!=l and j!=l and k!=l and G[j].y==G[l].y and abs(G[i].y-G[j].y)==abs(G[i].x-G[k].x)
	and abs(G[i].y-G[j].y)==abs(G[j].x-G[l].x) and G[k].x==G[l].x)
	{
		int maxnx=G[i].x;
		maxnx=max(maxnx,G[j].x);
		maxnx=max(maxnx,G[k].x);
		maxnx=max(maxnx,G[l].x);
		int minnx=G[i].x;
		minnx=min(minnx,G[j].x);
		minnx=min(minnx,G[k].x);
		minnx=min(minnx,G[l].x);

		int maxny=G[i].y;
		maxny=max(maxny,G[j].y);
		maxny=max(maxny,G[k].y);
		maxny=max(maxny,G[l].y);
		int minny=G[i].y;
		minny=min(minny,G[j].y);
		minny=min(minny,G[k].y);
		minny=min(minny,G[l].y);

		//cout<<i<<" "<<j<<" "<<k<<" "<<l<<" "<<maxnx<<" "<<minnx<<" "<<maxny<<" "<<minny<<endl;

		int cnt=0,x,y;
		for (int i=1;i<=4*n+1;i++)
		if (!(G[i].x>=minnx and G[i].x<=maxnx and G[i].y>=minny and G[i].y<=maxny) or
		(G[i].x>minnx and G[i].x<maxnx and G[i].y>minny and G[i].y<maxny))
		{
			x=G[i].x;
			y=G[i].y;
			cnt++;
		}
	//	cout<<cnt<<endl;
		if (cnt==1)
		{
			cout<<x<<" "<<y;
			return 0;
		}

	}

}

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
int n;
pair<int,int> point[100];
bool vis[60][60],v2[60][60];
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		cin>>point[i].first>>point[i].second;
		vis[point[i].first][point[i].second]=true;
	}
	for(int i=1;i<=50;i++){//SIZE
		for(int j=0;j<=50;j++){
			for(int k=0;k<=50;k++){//左上
				memset(v2,0,sizeof(v2));
				for(int l=0;l<i;l++){//上
					v2[j][k+l]=true;
				}
				for(int l=0;l<i;l++){//左
					v2[j+l][k]=true;
				}
				for(int l=0;l<i;l++){//下
					v2[j+i-1][k+l]=true;
				}
				for(int l=0;l<i;l++){//右
					v2[j+l][k+i-1]=true;
				}
				int cnt=0;
				pair<int,int> pos;
				for(int l=1;l<=4*n+1;l++){
					if(!v2[point[l].first][point[l].second]){
						cnt++;
						pos=point[l];
					}
				}
				if(cnt==1){
					cout<<pos.first<<' '<<pos.second<<endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

#include <cstdio>
//#include <bits/stdc++.h>
#define maxn 100

//using namespace std;
int x[maxn], y[maxn];

int main() {
	int n, Mix, Max, Miy, May, c;

	scanf("%d", &n);

	for(int i = 1; i <= 4 * n + 1; ++i) {
		scanf("%d%d", x + i, y + i);
	}

	for(Mix = c = 0; Mix <= 50; ++Mix) {
		for(int i = 1; i <= 4 * n + 1; ++i) if(x[i] == Mix) ++c;
		if(c >= n) break;
	}
	for(Max = 50, c = 0; Max >= 0; --Max) {
		for(int i = 1; i <= 4 * n + 1; ++i) if(x[i] == Max) ++c;
		if(c >= n) break;
	}
	for(Miy = c = 0; Miy <= 50; ++Miy) {
		for(int i = 1; i <= 4 * n + 1; ++i) if(y[i] == Miy) ++c;
		if(c >= n) break;
	}
	for(May = 50, c = 0; May >= 0; --May) {
		for(int i = 1; i <= 4 * n + 1; ++i) if(y[i] == May) ++c;
		if(c >= n) break;
	}
	for(int i = 1; i <= 4 * n + 1; ++i) {
		if((x[i] == Mix || x[i] == Max) && Miy <= y[i] && y[i] <= May) continue;
		else if((y[i] == Miy || y[i] == Max) && Mix <= x[i] && x[i] <= Max) continue;
		printf("%d %d", x[i], y[i]);
		return 0;
	}

	return 0;
}

#include <algorithm>
#include <iostream>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstdint>
#include <cstdio>
#include <vector>
#include <string>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <cstring>
#include <assert.h>
#include <chrono>
#include <random>
#include <functional>
#include <bitset>
#include <iterator>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#ifndef ONLINE_JUDGE
std::ostream& Debug() {
  return std::cerr;
}
#else
struct EmptyStream {
  template <typename T>
  EmptyStream& operator<<(const T& o) {
    return *this;
  }
};

EmptyStream& Debug() {
  static EmptyStream empty_stream;
  return empty_stream;
}
#endif

constexpr int N = 2.1e5;
constexpr int MOD = 998244353;

int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<pair<int, int> > pts;
  for (int i = 0; i < 4 * n + 1; i++) {
    int x, y;
    cin >> x >> y;
    pts.emplace_back(x, y);
  }
  for (int lx = -50; lx <= 50; lx++) {
    for (int ly = -50; ly <= 50; ly++) {
      for (int leng = 0; leng <= 100; leng++) {
	vector<pair<int, int> > noton;
	for (int i = 0; i < 4 * n + 1; i++) {
	  // need to be X = lx, y between ly and ly + leng
	  // need to be y = ly, x between lx and lx + leng
	  int x = pts[i].first;
	  int y = pts[i].second;
	  if (x == lx && y >= ly && y < ly + leng) continue;
	  if (y == ly && x >= lx && x < ly + leng) continue;
	  if (x == lx + leng - 1 && y >= ly && y < ly + leng) continue;
	  if (y == ly + leng - 1 && x >= lx && x < lx + leng) continue;
	  noton.push_back(pts[i]);
	}
	if (noton.size() == 1) {
	  cout << noton.back().first << ' ';
	  cout << noton.back().second << '\n';
	  exit(0);
	}
      }
    }
  }
  return 0;
}

#include <bits/stdc++.h>

typedef long long ll;
const ll MOD = 1000000007;

using namespace std;

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    vector<pair<int, int> > points;
    vector<pair<int, int> >::iterator be, en;
    cin >> n;
    for (int i = 0; i < 4 * n + 1; i++) {
        int x, y;
        cin >> x >> y;
        points.push_back({x, y});
    }
    sort(points.begin(), points.end());
    for (be = points.begin(); (be->first) == (points.begin()->first); be++)
        ;
    for (en = points.end(), en--; (en->first) == (points.end()->first); en--)
        ;
    sort(be, en, comp);
    auto it = be;
    for (; (it->second) == (be->second); it++)
        ;
    cout << (it->first) << " " << (it->second);
    return 0;
}

#include <bits/stdc++.h>
namespace myland{
    using namespace std;
    namespace _abbr{
        #define fi first
        #define se second
        #define pb push_back
        #define pr make_pair
        #define lb lower_bound
        #define ub upper_bound
        #define str string
        #define _1s __builtin_popcountll
        #define nth(a,l,r,k) nth_element(a+l,a+l+k-1,a+r+1)
        typedef unsigned int ui;
        typedef long long ll;
        typedef unsigned long long ull;
        typedef double db;
        typedef long double ld;
        typedef pair<int,int> pii;
        typedef pair<ll,ll> pll;
        typedef vector<int> vi;
        typedef vector<ll> vl;
        typedef vector<pii> vpii;
        typedef vector<pll> vpll;
        typedef vector<vi> vvi;
        typedef vector<vl> vvl;
        typedef vector<vpii> vvpii;
        typedef vector<vpll> vvpll;
    }using namespace _abbr;
    namespace _constant{
        const double EPS(1e-8);
        const double PI(acos(-1.0));
        const int INF(0x3f3f3f3f);
        const ll INFL(0x3f3f3f3f3f3f3f3fll);
        const int MOD(1e9+7);//998244353, 16341163, 999983
        const int dx[]={-1,0,1,0,-1,1,1,-1}, dy[]={0,1,0,-1,1,1,-1,-1};
    }using namespace _constant;
    namespace _solve{
        #define XOR int main()
        #define GG exit(0)
        #define rep(x,a,b) for(int x=a;x<=b;x++)
        #define per(x,a,b) for(int x=b;x>=a;x--)
        #define times(x) for(int cas=1,tms=(x);cas<=tms;cas++)
        #define CaseT int T;cin >> T;times(T)
        #define TCase int T;scanf("%d",&T);times(T)
        #define continue(_) if(_) continue;
        #define break(_) if(_) break;
    }using namespace _solve;
    namespace _calculate{
        bool odd(ll x){return x&1;}
        bool even(ll x){return (x&1)^1;}
        bool posi(ll x){return x>0;}
        bool nega(ll x){return x<0;}
        bool zero(ll x){return x==0;}
        bool prime(ll x){if(x<2) return 0;
            for(int i=2;i*i<=x;i++) if(x%i==0) return 0;
            return 1;}
        ll droot(ll x){return 1+(x-1)%9;}
        ll upd(ll a, ll b){return a%b?a/b+1:a/b;};
        ll random(ll a, ll b){return a+rand()*rand()%(b-a+1);};
        ll bitn(ll x){ll c=0;while(x)c++,x>>=1;return c;}
        template<class T>T sqr(T x){return x*x;}
        ll qpow(ll a, ll n, ll mod = MOD){
            ll res(1);while(n){
            if(n&1) (res*=a)%=mod;
            (a*=a)%=mod;n>>=1;}
            return res%mod;}
        ll inv(ll a, ll mod = MOD){return qpow(a,mod-2);}
        template<class T>void tomin(T& a,T b){if(b<a) a=b;}
        template<class T>void tomax(T& a,T b){if(b>a) a=b;}
    }using namespace _calculate;
    namespace _simple_algo{
        #define rg(a,x,y) (a+x), (a+y+1)
        #define vrg(a,x,y) (a.begin()+x),(a.begin()+y+1)
        #define all(x) (x).begin(),(x).end()
        #define rall(x) (x).rbegin(),(x).rend()
        #define clr(a,b) memset(a,b,sizeof(a))
        #define fil(a,b) fill(all(a),b)
        #define _sum(a) accumulate(a, 0ll)
        #define sz(a) (ll(a.size()))
        ll sol(const string& s){ll x=0;
            for(char c:s)x=x*10+c-48;return x;}
        string los(ll x){string s = "";
            if(x==0) return "0";
            while(x) s=char(x%10+48)+s,x/=10;
            return s;}
        bool pal(const string& s){int l = s.size();
            for(int i=0,j=l-1;i<j;i++,j--)
                if(s[i]!=s[j]) return 0;return 1;}
    }using namespace _simple_algo;
    namespace _io{
        #define FAST_IO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
        #define bug cerr << "!!!" << endl;
        #define bugc(_) cerr << (#_) << " = " << (_) << endl;
        template<class T>void rd(T& x){cin>>x;}
        str srd(){str s;cin>>s;return s;}
        ll rd(){
            ll x=0,f=1;char ch=getchar();
            while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
            while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
            return x*f;}
        void rd(int& x){x=rd();}
        void rd(ll& x){x=rd();}
        template<class A,class B>void rd(A& a,B& b){rd(a), rd(b);}
        template<class A,class B>void rd(pair<A,B>& p){rd(p.fi, p.se);}
        template<class A,class B,class C>void rd(A& a,B& b,C& c){rd(a,b);rd(c);}
        template<class T>void wt(const T& x){cout << x << '\n';}
        template<class T>void wt(const T& x, char c){cout << x << c;}
        template<class T>void wt(const T& x, const str& s){cout << x << s;}
        template<class T>void wt(const T& x, int rnd){
            cout << fixed << setprecision(rnd) << x << '\n';}
        template<class T>void wt(const vector<T>& v){
            for(int i=0;i<sz(v);i++){cout << v[i];if(i<sz(v)-1) cout << ' ';};wt("");}
        template<class A,class B>void wt(const pair<A,B>& pr){
            cout << pr.fi << ' ' << pr.se << '\n';}
    }using namespace _io;
}using namespace myland;
const int N = 105;

int n;
pii a[N];
int c[N], r[N];

XOR{
    rd(n);
    rep(i,1,4*n+1) rd(a[i]);
    rep(i,1,4*n+1) c[a[i].fi]++, r[a[i].se]++;
    rep(i,0,50) if(c[i]==1) rep(j,1,4*n+1) if(a[j].fi == i) wt(a[j]),GG;
    rep(i,0,50) if(r[i]==1) rep(j,1,4*n+1) if(a[j].se == i) wt(a[j]),GG;
    int c1 = 1, d1 = 1;
    int x = -1, y = -1;
    rep(i,0,50) {
        if(c1 == 0 && c[i]>2){
            x = i;
            break;
        }
        if(c[i]==n+1){
            c1--;
            continue;
        }
    }
    rep(i,0,50) {
        if(d1 == 0 && r[i]>2){
            y = i;
            break;
        }
        if(r[i]==n+1){
            d1--;
            continue;
        }
    }
    wt(pr(x, y));
}

/*
3
0 0
0 1
0 2
0 3
1 0
1 3
2 0
2 3
3 0
3 1
3 2
3 3
1 2
*/

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string.h>
#include <queue>
#include <math.h>
#include <set>
using namespace std;

typedef long long ll;
#define FOR(i,n,m) for(int i=n; i<m; i++)
#define ROF(i,n,m) for(int i=n; i>m; i--)
#define ri(a) scanf("%d",&a)
#define rii(a,b) ri(a),ri(b)
#define riii(a,b,c) rii(a,b),ri(c)
#define lri(a) scanf("%lld",&a)
#define lrii(a,b) lri(a),lri(b)
#define _1 first
#define _2 second
struct trip{int a, b, c;};

const int INF = 0x3f3f3f3f;
const ll INFLL = 1e18;
const int MOD = 1e9+7;
const int alphabet = 26;
const int MAXINT = 2e5+1;

const int N = 51; 					// ________---------------
int p, a, b, row[N], col[N], n;
bool M[N][N];
vector< pair<int,int> > r, c, points;

bool comp(pair<int,int> p1, pair<int,int> p2){
	if( p1._1 == p2._1 ) return p1._2 < p2._2;
	return p1._1 > p2._1;
}

bool comp2(pair<int,int> p1, pair<int,int> p2){
	if( p1._1 == p2._1 ) return p1._2 > p2._2;
	return p1._1 > p2._1;
}

int main(){
	ri(n);
	p = 4*n+1;
	while(p--){
		rii(a,b);
		row[a]++;
		col[b]++;
		points.push_back({a,b});
	}

	FOR(i,0,N) r.push_back({row[i],i});
	FOR(i,0,N) c.push_back({col[i],i});

	int rowl, rowr, coll, colr;

	sort(r.begin(),r.end(),comp);
	rowl = r[0]._2;
	sort(r.begin(),r.end(),comp2);
	rowr = r[0]._2;
	if( rowl == rowr ) rowr = r[1]._2;

	sort(c.begin(),c.end(),comp);
	coll = c[0]._2;
	sort(c.begin(),c.end(),comp2);
	colr = c[0]._2;
	if( coll == colr ) colr = c[1]._2;

	int x = -1, y = -1;
	for(auto p: points){
		x = p._1, y = p._2;
		if( x!=rowl && x!=rowr && y!=coll && y!=colr ) break;
		else if( (x==rowl || x==rowr) && !( y>=coll && y<=colr ) ) break;
		else if( (y==coll || y==colr) && !( x>=rowl && x<=rowr ) ) break;
	}

	cout << x << " " << y << endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define X first
#define Y second

int n;
vector<pair<int,int> > pt;

bool is_ok(int id){
    int min_x = INT_MAX, max_x = 0;
    int min_y = INT_MAX, max_y = 0;
    for(int i = 0; i < n; i++){
        if(i==id) continue;
        min_x = min(min_x,pt[i].X), max_x = max(max_x, pt[i].X);
        min_y = min(min_y,pt[i].Y), max_y = max(max_y, pt[i].Y);
    }
    for(int i = 0; i < n; i++){
        if(id==i) continue;
        pt[i].X-=min_x;
        pt[i].Y-=min_y;
    }
    max_x-=min_x, max_y-=min_y;
    if(max_x!=max_y) return false;
    vector<vector<int> > tab(max_x+1, vector<int>(max_x+1,0));
    for(int i = 0; i < n; i++){
        if(id==i) continue;
        tab[pt[i].X][pt[i].Y] = 1;
    }

    int cnt = -2;
    for(int i = 0; i <= max_x; i++) cnt+= tab[0][i],cnt+= tab[i][0];
    for(int i = max_x; i >= 1; i--) cnt+= tab[i][max_x], cnt+=tab[max_x][i];
    for(int i = 0; i < n; i++){
        if(id==i) continue;
        pt[i].X+=min_x;
        pt[i].Y+=min_y;
    }
//    cout << cnt << "\n";
    return (cnt==n-1);
}

int main()
{
    cin >> n;
    n = 4*n+1;
    pt.resize(n);
    for(int i = 0; i < n; i++) cin >> pt[i].X >> pt[i].Y;
    for(int i = 0; i < n; i++){
        bool ok = is_ok(i);
        if(ok) {
            cout << pt[i].X << " " << pt[i].Y << "\n";
            return 0;
        }
    }
    return 0;
}

#include <bits/stdc++.h>
#define ever ;;
#define ff first
#define ss second
#define pb push_back
#define endl '\n'
#define all(A) A.begin(),A.end()
#define Reverse(A) reverse(all(A))
#define Sort(A) sort(all(A))
#define IOS ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sign(x) (x>=0?1:-1)
#define qclear(A) while(!A.empty())A.pop();
#define rep(i,st,dr)for(int i=st;i<=dr;i++)
#define vctafis(A) for(auto i:A)cout<<i<<" ";
#define qafis(A) while(!A.empty())cout<<A.front()<<" ",A.pop();
#define matafis(A,n,m)\
for(int i=1;i<=n;i++,cout<<endl) \
    for(int j=1;j<=m;j++)\
        cout<<A[i][j]<<" ";
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef queue<int> qi;
typedef queue<pii> qpii;
typedef queue<ll> qll;
const int dx[]= {0,0,1,-1},dy[]= {-1,1,0,0};
const int dxx[]= {0,0,1,-1,-1,-1,1,1},dyy[]= {-1,1,0,0,1,-1,1,-1};
ifstream f("");
ofstream g("");
int main()
{IOS
int n;
    cin>>n;
    vpii v(0);
    int m=n+1;
    for(int a,b,i=1;i<=4*n+1;i++)
    cin>>a>>b,v.pb({a,b});
    Sort(v);
    if(v[0].ff+n==v.back().ff and v[0].ss+n==v.back().ss)
    {
        int c1=v[0].ff,c2=v[0].ss,c3=v.back().ff,c4=v.back().ss;
        for(auto i:v)
        {
            bool ok1=(i.ss==c2 and i.ff>=c1 and i.ff<=c3);
            bool ok2=(i.ss==c4 and i.ff>=c1 and i.ff<=c3);
            bool ok3=(i.ff==c1 and i.ss>=c2 and i.ss<=c4);
            bool ok4=(i.ff==c3 and i.ss>=c2 and i.ss<=c4);
            ok1|=ok2|ok3|ok4;
            if(!ok1){cout<<i.ff<<" "<<i.ss;return 0;}
        }
    }
    if(v[0].ff+n==v[v.size()-1].ff and v[0].ss+n==v[v.size()-1].ss)
    {
        int c1=v[0].ff,c2=v[0].ss,c3=v[v.size()-1].ff,c4=v[v.size()-1].ss;
        for(auto i:v)
        {
            bool ok1=(i.ss==c2 and i.ff>=c1 and i.ff<=c3);
            bool ok2=(i.ss==c4 and i.ff>=c1 and i.ff<=c3);
            bool ok3=(i.ff==c1 and i.ss>=c2 and i.ss<=c4);
            bool ok4=(i.ff==c3 and i.ss>=c2 and i.ss<=c4);
            ok1|=ok2|ok3|ok4;
            if(!ok1){cout<<i.ff<<" "<<i.ss;return 0;}
        }
    }
    if(v[1].ff+n==v.back().ff and v[1].ss+n==v.back().ss)
    {
        int c1=v[1].ff,c2=v[1].ss,c3=v.back().ff,c4=v.back().ss;
        for(auto i:v)
        {
            bool ok1=(i.ss==c2 and i.ff>=c1 and i.ff<=c3);
            bool ok2=(i.ss==c4 and i.ff>=c1 and i.ff<=c3);
            bool ok3=(i.ff==c1 and i.ss>=c2 and i.ss<=c4);
            bool ok4=(i.ff==c3 and i.ss>=c2 and i.ss<=c4);
            ok1|=ok2|ok3|ok4;
            if(!ok1){cout<<i.ff<<" "<<i.ss;return 0;}
        }
    }
    if(v[1].ff+n==v[v.size()-1].ff and v[1].ss+n==v[v.size()-1].ss)
    {
        int c1=v[0].ff,c2=v[0].ss,c3=v[v.size()-1].ff,c4=v[v.size()-1].ss;
        for(auto i:v)
        {
            bool ok1=(i.ss==c2 and i.ff>=c1 and i.ff<=c3);
            bool ok2=(i.ss==c4 and i.ff>=c1 and i.ff<=c3);
            bool ok3=(i.ff==c1 and i.ss>=c2 and i.ss<=c4);
            bool ok4=(i.ff==c3 and i.ss>=c2 and i.ss<=c4);
            ok1|=ok2|ok3|ok4;
            if(!ok1){cout<<i.ff<<" "<<i.ss;return 0;}
        }
    }
        return 0;
}

#include<bits/stdc++.h>

// #include <ext/pb_ds/assoc_container.hpp>                // a non-standard tree in g++
// #include <ext/pb_ds/tree_policy.hpp>

#define ll unsigned long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define umap map
#define INF 100000000000000000
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define all(v) v.begin(),v.end()
using namespace std;

// using namespace __gnu_pbds;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// pos.find_by_order(numbereth element you want)    returns an iterator to that element

ll binpow(ll a, ll b, ll m) {                           //binary exponentiation with mod m (a^b)%m
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

ll xy(ll a, ll b, ll& x, ll& y) {                      //eucledian for finding x,y s.t ax+by=g , g=gcd(a,b)
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll x1, y1;
    int d = xy(b, a % b, x1, y1);
    x = y1;
    y = x1 - y1 * (a / b);
    return d;
}

void phi_1_to_n(int n) {                                //euler's totient function for i=1 to i=n in n log log n time
    vector<int> phi(n + 1);
    phi[0] = 0;
    phi[1] = 1;
    for (int i = 2; i <= n; i++)
        phi[i] = i;

    for (int i = 2; i <= n; i++) {
        if (phi[i] == i) {
            for (int j = i; j <= n; j += i)
                phi[j] -= phi[j] / i;
        }
    }
}

ll lcm(ll a,ll b)
{
    return (a*b)/(__gcd(a,b));
}

ll mod(ll a,ll b)
{
    if(a<0)
    {
        return (b+a%b)%b;
    }
    return a%b;
}
// ll md(ll n)
// {
//     vector<ll>v;
//     while(n>0)
//     {
//         v.pb(n%10);
//         n/=10;
//     }
//     return (*min_element(v.begin(),v.end()))*(*max_element(v.begin(),v.end()));
// }

// int diff(string s1,string s2)
// {
//     int ans=0;
//     for(int i=0;i<s1.length();i++)
//     {
//         if(s1[i]!=s2[i])
//         {
//             ans++;
//         }
//     }
//     if(ans<=1)
//     return 1;
//     return 0;
// }

// ll term(ll x,ll y)                                           1 2 4 7             general term for this triangle
// {                                                            3 5 8
//     return (y*y-y+2)/2+(x-1)*y+(x-1)*(x)/2;                  6 9
// }                                                            10

int main()
{
    fastio;
	int t;
	// cin>>t;
    t=1;
    for(int hh=1;hh<=1;hh++)
	{
        ll n;
        cin>>n;
        vector<pair<int,int>>vp;
        vector<pair<int,int>>vp1;
        int x,y;
        for(int i=1;i<=4*n+1;i++)
        {
            cin>>x>>y;
            vp.pb(mp(x,y));
            vp1.pb(mp(y,x));
        }
        sort(all(vp));
        sort(all(vp1));
        ll freq[51]={0};
        ll freq2[51]={0};
        umap<int,bool>pres;
        umap<int,bool>pres2;
        int x1,y1,x2,y2;
        x2=-1;
        y2=-1;
        for(int i=0;i<vp.size();i++)
        {
            if(freq[vp[i].fi]==n)
            {
                pres[vp[i].fi]=true;
                x1=vp[i].fi;
                break;
            }
            freq[vp[i].fi]++;
        }
        for(int i=0;i<vp1.size();i++)
        {
            if(freq2[vp1[i].fi]==n)
            {
                pres2[vp1[i].fi]=true;
                y1=vp1[i].fi;
                break;
            }
            freq2[vp1[i].fi]++;
        }
        for(int i=vp.size()-1;i>=0;i--)
        {
            if(freq[vp[i].fi]==n)
            {
                pres[vp[i].fi]=true;
                x2=vp[i].fi;
                break;
            }
            freq[vp[i].fi]++;
        }
        for(int i=vp1.size()-1;i>=0;i--)
        {
            if(freq2[vp1[i].fi]==n)
            {
                pres2[vp1[i].fi]=true;
                y2=vp1[i].fi;
                break;
            }
            freq2[vp1[i].fi]++;
        }
        for(auto it:vp)
        {
            if(it.fi==x1 || it.fi==x2)
            {
                if(it.se<=y2 && it.se>=y1)
                {
                    continue;
                }
                else
                {
                    cout<<it.fi<<" "<<it.se;
                    exit(0);
                }
            }
            if(it.se==y1 || it.se==y2)
            {
                if(it.fi<=x2 && it.fi>=x1)
                {
                    continue;
                }
                else
                {
                    cout<<it.fi<<" "<<it.se;
                    exit(0);
                }
            }
            cout<<it.fi<<" "<<it.se;
            exit(0);
        }
    }
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
inline int read()
{
    char ch=getchar();
    int nega=1;
    while(!isdigit(ch))
    {
        if(ch=='-') nega=-1;
        ch=getchar();
    }
    int ans=0;
    while(isdigit(ch))
    {
        ans=ans*10+ch-48;
        ch=getchar();
    }
    if(nega==-1) return -ans;
    return ans;
}
int n;
struct Node{
	int x,y;
};
Node a[1005];
signed main(){
	n=read();
	for(int i=1;i<=4*n+1;i++){
		a[i].x=read();
		a[i].y=read();
	}
	for(int i=1;i<=4*n+1;i++){
		int b[55][55],minx=105,miny=105,maxx=-1,maxy=-1;
		memset(b,0,sizeof(b));
		for(int j=1;j<=4*n+1;j++){
			if(i==j)  continue;
			b[a[j].x][a[j].y]=1;
			minx=min(minx,a[j].x);
			miny=min(miny,a[j].y);
			maxx=max(maxx,a[j].x);
			maxy=max(maxy,a[j].y);
		}
		/*
		for(int i=minx;i<=maxx;i++){
			for(int j=miny;j<=maxy;j++){
				cout<<b[i][j]<<" ";
			}
			cout<<"\n";
		}
		*/
		bool ok=1;
		for(int j=minx;j<=maxx;j++){
			if(b[j][miny]==0)  ok=0;
			if(b[j][maxy]==0)  ok=0;
		}
		for(int j=miny;j<=maxy;j++){
			if(b[maxx][j]==0)  ok=0;
			if(b[minx][j]==0)  ok=0;
		}
		if(ok==1){
			cout<<a[i].x<<" "<<a[i].y<<"\n";
		}
	}
	return 0;
}

/*
 *
 *      I AM o0o0oo00.
 *
 */
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll          long long
#define p7          1000000007
#define p9          998244353
#define pb          push_back
#define ff          first
#define ss          second
#define vll         vector<ll>
#define pll         pair<ll,ll>
#define vpll        vector<pll>
#define mll         map<ll,ll>
#define test        ll T;cin>>T;while(T--)
#define ad(a,n)     vll a;a.resize(n);for(ll i=0;i<n;i++)cin>>a[i];
#define as(a,n)     for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<endl;
#define all(x)      x.begin(),x.end()

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

ll powm(ll x, ll y, ll m = p7) {
    x = x % m; ll res = 1; while (y)
    {if (y & 1)res = res * x; res %= m; y = y >> 1; x = x * x; x %= m;} return res;
}
ll modi(ll a, ll m = p7) {return powm(a, m - 2, m);}
void yesno(bool f) {f ? cout << "YES" << endl : cout << "NO" << endl;}

void ss99()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
}

int32_t main()
{
    ss99();
//    test
    {
        ll n; cin >> n;
        vpll vp;
        ll frx[51] = {0}, fry[51] = {0};
        for (ll i = 0; i <= 4 * n; i++)
        {
            ll x, y;
            cin >> x >> y;
            vp.pb({x, y});
            frx[x]++;
            fry[y]++;
        }
        ll mnx, mxx, mny, mxy;
        for (ll i = 0; i <= 50; i++)
        {
            if (frx[i] > 1)
            {
                mnx = i;
                break;
            }
        }
        for (ll i = 50; i >= 0; i--)
        {
            if (frx[i] > 1)
            {
                mxx = i;
                break;
            }
        }
        for (ll i = 0; i <= 50; i++)
        {
            if (fry[i] > 1)
            {
                mny = i;
                break;
            }
        }
        for (ll i = 50; i >= 0; i--)
        {
            if (fry[i] > 1)
            {
                mxy = i;
                break;
            }
        }
        for (ll i = 0; i <= 4 * n; i++)
        {
            ll xx = vp[i].ff, yy = vp[i].ss;
            if (xx != mxx && xx != mnx && yy != mny && yy != mxy)
            {
                cout << xx << " " << yy << endl;
                return 0;
            }
            if (xx < mnx || xx > mxx || yy < mnx || yy > mxy)
            {
                cout << xx << " " << yy << endl;
                return 0;
            }
        }
    }
    return 0;
}

// Hacheylight
#include <map>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <vector>
#include <bitset>
#include <cstdio>
#include <cctype>
#include <string>
#include <numeric>
#include <cstring>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std ;
//#define int long long
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define loop(it, v) for (auto it = v.begin(); it != v.end(); it++)
#define cont(i, x) for (int i = head[x]; i; i = e[i].nxt)
#define clr(a) memset(a, 0, sizeof(a))
#define ass(a, sum) memset(a, sum, sizeof(a))
#define lowbit(x) (x & -x)
#define all(x) x.begin(), x.end()
#define SC(t, x) static_cast <t> (x)
#define ub upper_bound
#define lb lower_bound
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define pof pop_front
#define pob pop_back
#define fi first
#define se second
#define y1 y1_
#define Pi acos(-1.0)
#define iv inline void
#define enter cout << endl
#define siz(x) ((int)x.size())
#define file(x) freopen(x".in", "r", stdin),freopen(x".out", "w", stdout)
typedef double db ;
typedef long long ll ;
typedef unsigned long long ull ;
typedef pair <int, int> pii ;
typedef vector <int> vi ;
typedef vector <pii> vii ;
typedef queue <int> qi ;
typedef queue <pii> qii ;
typedef set <int> si ;
typedef map <int, int> mii ;
typedef map <string, int> msi ;
const int N = 100010 ;
const int INF = 0x3f3f3f3f ;
const int iinf = 1 << 30 ;
const ll linf = 2e18 ;
const int MOD = 1000000007 ;
const double eps = 1e-7 ;
void douout(double x){ printf("%lf\n", x + 0.0000000001) ; }
template <class T> void print(T a) { cout << a << endl ; exit(0) ; }
template <class T> void chmin(T &a, T b) { if (a > b) a = b ; }
template <class T> void chmax(T &a, T b) { if (a < b) a = b ; }
template <class T> void add(T &a, T b) { a = (1ll * a + b) % MOD ; }
template <class T> void sub(T &a, T b) { a = (a - b + MOD) % MOD ; }
template <class T> void mul(T &a, T b) { a = (ll) a * b % MOD ; }
template <class T> T read() {
    int f = 1 ; T x = 0 ;
    char ch = getchar() ;
    while (!isdigit(ch)) { if (ch == '-') f = -1 ; ch = getchar() ; }
    while (isdigit(ch)) { x = x * 10 + ch -'0' ; ch = getchar() ; }
    return x * f ;
}

int n ;
int a[N], b[N] ;
map <pii, int> hsh ;

signed main() {
	scanf("%d", &n) ;
	rep(i, 1, 4 * n + 1) scanf("%d%d", &a[i], &b[i]) ;
	rep(i, 0, n) hsh[mp(0, i)] = 1, hsh[mp(n, i)] = 1 ;
	rep(i, 0, n) hsh[mp(i, 0)] = 1, hsh[mp(i, n)] = 1 ;
	rep(i, 1, 4 * n + 1)
	if (hsh.find(mp(a[i], b[i])) == hsh.end()) {
		cout << a[i] << " " << b[i] << endl ;
	}
}

/*
写代码时请注意：
	1.ll？数组大小，边界？数据范围？
	2.精度？
	3.特判？
	4.至少做一些
思考提醒：
	1.最大值最小->二分？
	2.可以贪心么？不行dp可以么
	3.可以优化么
	4.维护区间用什么数据结构？
	5.统计方案是用dp？模了么？
	6.逆向思维？
*/

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

int main() {
	// your code goes here'
	int n;
	cin>>n;
	int x[52]={0};int y[52]={0};
	int a[52],b[52];
	for(int i=0;i<4*n+1;i++){
		cin>>a[i]>>b[i];
	}int minx=10005;int miny=10005;int maxx=-1;int maxy=-1;
	for(int i=0;i<4*n+1;i++){
		x[a[i]]++;y[b[i]]++;
		if(minx>a[i]){
			minx=a[i];
		}if(maxx<a[i]){
			maxx=a[i];
		}
		if(miny>b[i]){
			miny=b[i];
		}if(maxy<b[i]){
			maxy=b[i];
		}
	}int j;
	for(int i=0;i<4*n+1;i++){
		  if(x[a[i]]==3&&y[b[i]]==3&&minx!=a[i]&&maxx!=a[i]&&miny!=b[i]&&maxy!=b[i]){
			cout<<a[i]<<" "<<b[i]<<endl;break;
		}
		else if(x[a[i]]==n+1&&y[b[i]]==1){
			cout<<a[i]<<" "<<b[i]<<endl;break;
		}else if(y[b[i]]==n+1&&x[a[i]]==1){
			cout<<a[i]<<" "<<b[i]<<endl;break;
		}
	}
	 return 0;
}

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")

    /*
    ||||||||||||||||||||||||||||||||||||||||||||||||
       |      |||         |      ||||    ||||  |   |
      | |     |   |      | |     |   |  |      |   |
     |   |    |    |    |   |    |   |  |      |   |
    |||||||   |    |   |||||||   |||     |||   |||||
    |     |   |   |    |     |   | |        |  |   |
    |     |   |||      |     |   |  ||  ||||   |   |
    ||||||||||||||||||||||||||||||||||||||||||||||||

    */
    using namespace std;
    //#include "testlib.h"
    #define ff first
    #define ss second
    #define mp make_pair
    #define all(v) v.begin(),v.end()
    #define int long long
    #define ll long long
    #define M 1000000007
    #define inputarr(a,n) for(int i=0;i<n;++i) cin>>a[i]
    #define GCD(m,n) __gcd(m,n)
    #define LCM(m,n) m*(n/GCD(m,n))
    #define mii  map<ll ,ll >
    #define msi  map<string,ll >
    #define mis  map<ll int, string>
    #define rep(a,b)    for(ll i=a;i<b;i++)
    #define rep0(n)    for(ll i=0;i<n;i++)
    #define repi(i,a,b) for(ll i=a;i<b;i++)
    #define pb push_back
    #define vi vector<ll>
    #define mp make_pair
    #define vs vector<string>
    #define ppb pop_back
    #define endl '\n'
    #define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    #define r0 return 0;
    #define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
    #define FORE(it, c) for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
    #define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
    #define input freopen("input.txt", "r", stdin);
    #define Set(a, s) 4(a, s, sizeof (a))
    #define FOR repi
    #define pii pair<int,int>
    //#define float long double
    ll max(ll a, ll b) { return (a > b)? a : b;}
    int min(int a, int b) { return (a < b)? a : b;}

    int n;
    vector<pii> v;
    vector<pii> find(int x1,int x2,int y1,int y2){
        int temp1=min(x1,x2),t2=max(x1,x2);
        x1=temp1;x2=t2;
        temp1=min(y1,y2);
        t2=max(y1,y2);
        y1=temp1;y2=t2;
        vector<pii> ans;
        FORE(it,v){
            int x=it->ff,y=it->ss,flag=1;
            if(x<x1||x>y2||y<y1||y>y2) flag=0;
            if(x!=x1&&x!=x2&&y!=y1&&y!=y2) flag=0;
            if(flag==0)
            ans.pb({x,y});

        }
        return ans;
    }
     int solve()
     {
        cin>>n;
        n=4*n+1;
        set<int> s1,s2;
        rep0(n){
            int x,y;
            cin>>x>>y;
            s1.insert(x);
            s2.insert(y);
            v.pb({x,y});
        }
        sort(all(v));
        vi a1,a2;
        FORE(it,s1) a1.pb(*it);
        FORE(it,s2) a2.pb(*it);
        rep0(2){
            FORD(j,a1.size()-1,a1.size()-2){
                repi(k,0,2){
                    FORD(l,a2.size()-1,a2.size()-2){
                        if(abs(a1[i]-a1[j])!=abs(a2[l]-a2[k])) continue;
                        auto it=find(a1[i],a1[j],a2[k],a2[l]);
                        if(it.size()==1) return cout<<it[0].ff<<" "<<it[0].ss,0;
                    }
                }
            }
        }

     }
    signed main()
    {
        asdf
        int t=1;
        //cin>>t;
        while(t--)
        {
            solve();
        }

}

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)

using namespace std;
using ll = long long;

int main()
{
	int  i = 0, n, min_x = INT_MAX, max_x = INT_MIN, min_y = INT_MAX, max_y = INT_MIN, x, y;
	cin >> n;
	n = 4 * n + 1;
	int temp = n;
	int xx[51] = { 0 }, yy[51] = { 0 };
	vector<pair<int, int>> p(4 * n + 100);
	while (n--)
	{
		cin >> x >> y;
		p[i].first = x;
		p[i].second = y;
		xx[x]++;
		yy[y]++;
		i++;
	}
	for (int i = 0; i <= 50; i++)
	{
		if (xx[i] >= 3)
		{
			if (i > max_x)
				max_x = i;
			if (i < min_x)
				min_x = i;
		}
		if (yy[i] >= 3)
		{
			if (i > max_y)
				max_y = i;
			if (i < min_y)
				min_y = i;
		}
	}
	//cout << min_x << " " << max_x << " " << min_y << " " << max_y;
	for (i = 0; i < temp; i++)
	{
		if ((p[i].first == min_x && p[i].second >= min_y && p[i].second <= max_y)
			|| (p[i].first == max_x && p[i].second >= min_y && p[i].second <= max_y)
			|| (p[i].second == min_y && p[i].first >= min_x && p[i].first <= max_x)
			|| (p[i].second == max_y && p[i].first >= min_x && p[i].first <= max_x))
		{
			// do nothing
		}
		else
		{
			cout << p[i].first << " " << p[i].second;
			break;
		}
	}
	return 0;
}

#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
#pragma GCC target("popcnt")
#include <bits/stdc++.h>
#define maxn 400010
#define ll long long
#define ull unsigned long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define pii pair<int, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define IL inline
#define ss system
using namespace std;

struct point {
  int x, y;
  bool operator < (const point &rhs) const {
    return x == rhs.x ? y < rhs.y : x < rhs.x;
  }
} ps[maxn];
int n;
template <class T> void read(T &x) {
  char ch = x = 0;
  bool fl = false;
  while (!isdigit(ch))
    fl |= ch == '-', ch = getchar();
  while (isdigit(ch))
    x = x * 10 + ch - '0', ch = getchar();
  x = fl ? -x : x;
}
bool check(int x) {
  vector<point> vec;
  for (int i = 1; i < x; i++) {
    vec.pb(ps[i]);
  }
  for (int i = x + 1; i <= n; i++) {
    vec.pb(ps[i]);
  }
  sort(vec.begin(), vec.end());
  int a = vec[0].x, b = vec[0].y, c = vec.back().x, d = vec.back().y;
  for (int i = 0; i < vec.size(); i++) {
    if (vec[i].x != a && vec[i].x != c && vec[i].y != b && vec[i].y != d)
      return false;
    if (vec[i].x < a || vec[i].x > c || vec[i].y < b || vec[i].y > d)
      return false;
  }
  return true;
}
int main() {
  cin >> n, n = 4 * n + 1;
  for (int i = 1; i <= n; i++) {
    cin >> ps[i].x >> ps[i].y;
  }
  for (int i = 1; i <= n; i++) {
    if (check(i))
      return cout << ps[i].x << " " << ps[i].y << endl, 0;
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define li long long int
#define le long double
#define mod 998244353
li res;
class dop
{public:
li n,p,q,r,e,f,g;
vector<pair<li,li>> a;
void get();
};
void dop::get()
{cin>>n;
for(li i=0;i<((4*n)+1);i++){cin>>p>>q;a.push_back(make_pair(p,q));}
for(li i=0;i<((4*n)+1);i++){r=1e18;e=-1e18;f=1e18;g=-1e18;
    for(li j=0;j<((4*n)+1);j++){if(j==i){continue;}
r=min(a[j].first,r);e=max(e,a[j].first);f=min(a[j].second,f);g=max(g,a[j].second);
}bool y=true;
for(li j=0;j<((4*n)+1);j++){if(j==i){continue;}
if((a[j].first==r||a[j].first==e)||(a[j].second==f||a[j].second==g)){continue;}y=false;break;}
if(y){
p=a[i].first;q=a[i].second;
if(!(p>=r&&p<=e&&q>=f&&q<=g)||(p>r&&p<e&&q>f&&q<g)){cout<<p<<" "<<q<<'\n';return ;}}}
}
int main()
{ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
li t=1;
dop obj[t];
for(li i=0;i<t;i++){obj[i].get();}
return 0;}

#include<bits/stdc++.h>
using namespace std;
const int N=100;
bool f[N][N],ok;
int n;
void check(int x,int y)
{
	for(int i=x;i<=x+n;i++)if(!f[i][y]||!f[i][y+n])ok=false;
	for(int j=y;j<=y+n;j++)if(!f[x][j]||!f[x+n][j])ok=false;
}
void draw(int x,int y)
{
	for(int i=x;i<=x+n;i++)f[i][y]=f[i][y+n]=false;
	for(int j=y;j<=y+n;j++)f[x][j]=f[x+n][j]=false;
}
int main()
{
	cin>>n;
	for(int i=0;i<4*n+1;i++)
	{
		int a,b;
		cin>>a>>b;
		f[a][b]=true;
	}
	for(int i=0;i+n<=50;i++)
	{
		for(int j=0;j+n<=50;j++)
		{
			ok=true;
			check(i,j);
			if(ok)
			{
				draw(i,j);
				for(int ii=0;ii<=50;ii++)
				{
					for(int jj=0;jj<=50;jj++)
					{
						if(f[ii][jj])
						{
							cout<<ii<<' '<<jj<<endl;
							return 0;
						}
					}
				}
			}
		}
	}
}

#include<cstdio>
#include<algorithm>
#include<cstdio>
#include<iostream>
using namespace std;
struct Node{
	int x,y;
}node[200000];
int n,book[1000][1000],heng[1000],shu[1000];
int main(){
	cin>>n;
	for(int i=1;i<=4*n+1;i++){
		cin>>node[i].x>>node[i].y;
		book[node[i].x][node[i].y]=1;
		heng[node[i].x]=1;shu[node[i].y]=1;
	}
	int minx=0x3f3f3f3f,miny=0x3f3f3f3f,maxx=0,maxy=0;
	for(int i=1;i<=4*n+1;i++){
		minx=min(minx,node[i].x);
		miny=min(miny,node[i].y);
		maxx=max(maxx,node[i].x);
		maxy=max(maxy,node[i].y);
	}
	int flag=0;
	if((maxx-minx)*(maxy-miny)>n*n) flag=1;//在正方形边界外
	if(flag){
		//向右扫
		for(int i=0;i<=55;i++){
			if(heng[i]){
				int sum=0;
				for(int j=0;j<=55;j++)
				if(book[i][j]) sum++;
				if(sum==1){
					for(int j=0;j<=55;j++)
					if(book[i][j]) return printf("%d %d",i,j),0;
				}
			}
		}
		//向上扫
		for(int i=0;i<=55;i++){
			if(shu[i]){
				int sum=0;
				for(int j=0;j<=55;j++)
				if(book[j][i]) sum++;
				if(sum==1){
					for(int j=0;j<=55;j++)
					if(book[j][i]) return printf("%d %d",j,i),0;
				}
			}
		}
	}
	else{
		for(int i=1;i<=4*n+1;i++){
			if(node[i].x>minx&&node[i].x<maxx&&node[i].y>miny&&node[i].y<maxy)
			return printf("%d %d",node[i].x,node[i].y),0;
			if(node[i].x<minx||node[i].x>maxx||node[i].y<miny||node[i].y>maxy)
			return printf("%d %d",node[i].x,node[i].y),0;
		}
	}
	return 0;
}

#include <sstream>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<ctime>
#include<cmath>
#include<map>
#include<stack>
#include<random>
#include<queue>
#include<list>
#include<math.h>
#include<bitset>
#include<fstream>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < int(n); i++)
const ll INF=9223372036854775807;
const ll mod=1000000007;
int  MOD(int  a, int  b)
{
    if(a>b)
        return a-b;
    else
        return b-a;
}
ll  max3(ll  a,ll  b, ll  c)
{
    return max(c,max(a,b));
}
ll min3(ll  a,ll  b,ll  c)
{
    return min(a,min(b,c));
}
ll  power(ll  x,ll  y,ll mod1)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%mod1;
        y = y>>1;
        x = (x*x)%mod1;
    }
    return res;
}
ll logg(ll  a)
{
    ll  x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
}
ll  gcd(ll  a,ll   b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll abso(ll x)
{
    if(x<0)
    {
        return -x;
    }
    return x;
}
ll ceiling (ll  a,ll  b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
ll modinv(ll x,ll p)
{
    return power(x,p-2,p);
}
int main()
{
    int n;
    cin>>n;
    vector<int> x(4*n+1),y(4*n+1);vvi grid(51);
    for(int i=0;i<=50;i++)
    {
        grid[i].resize(51);
    }
    for(int i=0;i<4*n+1;i++)
    {
        cin>>x[i]>>y[i];
    }
    n=4*n+1;
    for(int k=0;k<n;k++)
    {
        set<int> xx,yy;
        for(int j=0;j<n;j++)
        {
            if(j!=k)
            {
                xx.insert(x[j]);
                yy.insert(y[j]);
            }
        }
        bool c=true;
        for(int j=0;j<n;j++)
        {
            if(j!=k)
            {
                if((x[j]==(*xx.begin())||x[j]==(*xx.rbegin()))&&(y[j]<=(*yy.rbegin())&&y[j]>=*yy.begin()))
                {

                }
                else
                {
                    if((y[j]==(*yy.begin())||y[j]==(*yy.rbegin()))&&(x[j]<=(*xx.rbegin())&&x[j]>=*xx.begin()))
                    {

                    }
                    else
                    {
                        c=false;
                    }
                }
            }
        }
        if(c)
        {
            cout<<x[k]<<' '<<y[k]<<endl;
            return 0;
        }
    }
}

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <functional>
#include <ctime>
#include <iomanip>
#include <sstream>
#include <algorithm>
#define ll long long
#define ull unsigned long long
#define dd double
#define mes(x,y) memset(x,y,sizeof(x))\

const ll maxn=1e5+10;
using namespace std;
ll GCD(ll a,ll b) {//最大公约数
    return b == 0 ? a : GCD(b, a % b);
}
struct node{
    ll x,y;
}a[maxn];
bool cmp(node n1,node n2) {
    if (n1.x < n2.x)return true;
    else if (n1.x > n2.x) return false;
    else return n1.y < n2.y;
}
int main() {
    std::ios::sync_with_stdio(false);
    ll n, i, j;
    while (cin >> n) {
        ll m = n;
        m = n * 4 + 1;
        map<pair<ll, ll>, ll> m1, m2;
        m1.clear();
        m2.clear();
        pair<ll, ll> st, sv, sk;
        for (i = 0; i < m; i++) {
            cin >> a[i].x >> a[i].y;
            st.first = a[i].x;
            st.second = a[i].y;
            m1[st]++;
        }
        sort(a, a + n, cmp);
        st.first = a[0].x + 1;
        sv.first = a[0].x;
        st.second = a[0].y;
        sv.second = a[0].y + 1;
        if (!m1[st] || !m1[sv]) {
            cout << a[0].x << " " << a[0].y << endl;
            continue;
        }
        st.first = a[0].x;
        st.second = a[0].y;
        m2[st] = 1;
        sv.first = a[0].x + n;
        sv.second = a[0].y + n;
        m2[sv] = 1;
        for (i = 1; i <= n; i++) {
            st.first = a[0].x + i;
            st.second = a[0].y;
            m2[st] = 1;
            st.first = a[0].x;
            st.second = a[0].y + i;
            m2[st] = 1;
            sv.first = a[0].x + n - i;
            sv.second = a[0].y + n;
            m2[sv] = 1;
            sv.first = a[0].x + n;
            sv.second = a[0].y + n - i;
            m2[sv] = 1;
        }
        for (i = 0; i < m; i++) {
            st.first = a[i].x;
            st.second = a[i].y;
            if (!m2[st] || m1[st] > 1) {
                cout << a[i].x << " " << a[i].y << endl;
            }
        }
    }
}
/**
2
1 1
1 2
1 3
2 1
3 1
3 2
3 3
2 3

 **/

//* AuThOr GaRyMr *//
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int a[55][55];
int main(){
	int n;
	scanf("%d",&n);
	n*=4;
	n++;
	rb(i,1,n){
		int xi,yi;
		scanf("%d %d",&xi,&yi);
		a[xi][yi]=1;
	}
	rb(i,0,55){
		rb(j,0,55){
			rb(k,i,55){
				rb(l,0,j){
					int tot=0;
					rb(h,i,k){
						rb(y,l,j){
							if(h!=i&&h!=k&&y!=l&&y!=j) continue;
							tot+=a[h][y];
						}
					}
					if(tot==n-1){
						rb(h,i,k){
						rb(y,l,j){
							if(h!=i&&h!=k&&y!=l&&y!=j) continue;
							a[h][y]=0;
						}
						}
						rb(h,0,55){
							rb(y,0,55){
								if(a[h][y]){
//									cout<<"-"<<i<<","<<j<<"&"<<k<<","<<l<<endl;
									printf("%d %d\n",h,y);
									return 0;
								}
							}
						}
						return 0;
					}
				}
			}
		}
	}
	return 0;
}

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>

using namespace std;
using pii=pair<int,int>;
using ll=long long;

pii getp(map<int,int>& y, int& n)
{
    if(y.size()==n+2){
        if(y.begin()->second==1){
            auto it=y.begin();
            it++;
            return {it->first,y.rbegin()->first};
        }
        else{
            auto it=y.rbegin();
            it++;
            return {y.begin()->first,it->first};
        }
    }
    return {y.begin()->first,y.rbegin()->first};
}

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

    int n;
    cin>>n;
    map<int,int> x,y;
    vector<pii> p(4*n+1);
    for(int i=0; i<4*n+1; i++){
        int a,b;
        cin>>a>>b;
        p[i]={a,b};
        auto ret=y.insert({a,1});
        if(!ret.second) ret.first->second+=1;
        ret=x.insert({b,1});
        if(!ret.second) ret.first->second+=1;
    }

    pii yp=getp(y,n),xp=getp(x,n);
    pii answer;

    for(int i=0; i<4*n+1; i++){
        if((p[i].first==yp.first || p[i].first==yp.second) && (p[i].second>=xp.first || p[i].second<=xp.second));
        else if((p[i].first>=yp.first || p[i].first<=yp.second) && (p[i].second==xp.first || p[i].second==xp.second));
        else{
            answer=p[i];
        }
    }
    cout<<answer.first<<" "<<answer.second;

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

/*
テストケース全てに目を通す
テストケースが2個以下だったらなんかある
N最小のコーナーケースがないか調べる
制約をしっかりと確認する（1からNまでの順列、全て異なる値などの制約も含め）
操作の逆順を考える
Codeforcesではscanfを使う
エラー出力は消す
エラー出力を消せ！！！！！
 */

int main() {
    int n;
    cin >> n;
    int x[n];
    int y[n];
    rep(i,n){
        cin >> x[i] >> y[i];
    }
    int odx=-1;
    int ody=-1;
    rep(b,51){
        rep(a,b){
            rep(d,51){
                rep(c,d){
                    rep(i,n){
                        bool ng=false;
                        if(x[i]!=a && x[i]!=b && y[i]!=c && y[i]!=d)ng=true;
                        if(x[i]==a || x[i]==b){
                            if(y[i]<c || d<y[i])ng=true;
                        }
                        if(y[i]==c || y[i]==d){
                            if(x[i]<a || b<x[i])ng=true;
                        }
                        if(ng){
                            if(odx!=-1)break;
                            else{
                                odx=x[i];
                                ody=y[i];
                            }
                        }
                        if(i==n-1 && odx!=-1){
                            cout << odx+1 << ' ' << ody+1;
                            return 0;
                        }
                    }
                }
            }
        }
    }

}

/*

 */

#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x)
#define rl(x) scanf("%lld",&x)
#define rlcfpoj(x) scanf("%I64d",&x)
#define pi(x) printf("%d",x)
#define pl(x) printf("%lld",x)
#define plcfpoj(x) printf("%I64d",x)
#define lfd() printf("\n")
#define sp() printf(" ")
int n;
int x[50],y[50];
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>n;
	int m=4*n+1;
	for(int i=1;i<=m;i++)
		cin>>x[i]>>y[i];
	for(int i=1;i<=m;i++){
		int xmi=1e9,xma=-1e9,ymi=1e9,yma=-1e9;
		for(int j=1;j<=m;j++){
			if(i!=j){
				xmi=min(xmi,x[j]);
				xma=max(xma,x[j]);
				ymi=min(ymi,y[j]);
				yma=max(yma,y[j]);
			}
		}
		bool good=true;
		for(int j=1;j<=m;j++){
			if(i!=j){
				if(x[j]!=xmi&&x[j]!=xma&&y[j]!=ymi&&y[j]!=yma){
					good=false;
					break;
				}
			}
		}
		if(x[i]!=xmi&&x[i]!=xma&&y[i]!=ymi&&y[i]!=yma){
			if(good){
				cout<<x[i]<<' '<<y[i]<<endl;
				return 0;
			}
		}
	}
	return 0;
}