Go: package main

import (
    "fmt"
    "sort"
)

type Player struct {
    Name int
    Score  int
}

type Place []Player

func (p Place) Len() int {
    return len(p)
}

func (p Place) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}

func (p Place) Less(i, j int) bool {

	if p[i].Score == p[j].Score {
		return p[i].Name < p[j].Name
	} else {
		return p[i].Score > p[j].Score
	}
   
}

func DataEntry(n int) Place {
	var id, sc int
	var ranking Place
	var adding Player

	for i := 0; i < n; i++ {

		fmt.Scan(&id, &sc)

		adding.Name = id
		adding.Score = sc

		ranking = append(ranking, adding)
	}

	return ranking
}

func main() {
	var ranking Place
	var num int

		fmt.Scan(&num)
		ranking = DataEntry(num)
	
	sort.Sort(Place(ranking))
	fmt.Println(ranking[0].Name ,ranking[0].Score)
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

bool comb(pair<int,int> a,pair<int,int> b){
    if(a.first==b.first){
        return a.second>b.second;
    }else return a>b;
}

int main(){
    int n;cin>>n;
    vector<pair<int,int>> v(n);
    
    rep(i,0,n){
        cin>>v[i].se>>v[i].fi;
    }
    rep(i,0,n-1){
        rep(j,i+1,n){
            if(v[i].fi>v[j].fi){
                pair<int,int> temp;
                temp=v[i];
                v[i]=v[j];
                v[j]=temp;
            }else if(v[i].fi==v[j].fi){
                if(v[i].se<v[i].se){
                    pair<int,int> temp;
                    temp=v[i];
                    v[i]=v[j];
                    v[j]=temp;
                }
            }
        }
    }
    cout<<v[n-1].se<<" "<<v[n-1].fi<<endl;

    return 0;
}

C++: #include <cstdio>
#include <utility>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
	int n, a, b;
	scanf("%d", &n);
	vector<pair<int,int> > v(n);
	for(int i = 0; i < n; ++i){
		scanf("%d%d", &a, &b);
		v[i].first = b;
		v[i].second = -a;
	}

	const pair<int,int> &p = *max_element(v.begin(), v.end());
	printf("%d %d\n", -p.second, p.first);
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <complex>
#include <cmath>
#include <algorithm>
#include <map>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
int main(){
	int n,tmp1,tmp2;
	pair<int,int> ans;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>tmp1>>tmp2;
		if(tmp2>ans.second){
			ans.first=tmp1;
			ans.second=tmp2;
		}
		if(tmp2==ans.second){
			ans.first=min(tmp1,ans.first);
		}
	}
	cout<<ans.first<<' '<<ans.second<<endl;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
	int ta[10000]={0},n;
	cin>>n;
	for(int i=0;i<n;i++){
	int a,b;
	cin>>a>>b;
	ta[a]+=b;
	}
	int ans=0,ansi=10000;
	for(int i=0;i<10000;i++){
	if(ans<ta[i])ans=ta[i],ansi=i;
	if(ans==ta[i])ansi=min(ansi,i);
	}
	cout<<ansi<<" "<<ans<<endl;
	return 0;
}

C++: #include<iostream>
using namespace std;

int main(){
  int n,a,v,max=0,maxn=999;

  cin >>n;
  for(int i=0;i<n;++i){
    cin >>a >>v;
    if(v>max){
      max=v;
      maxn=a;
    }
    else if(v==max)
      if(a<maxn) maxn=a;
  }
  cout <<maxn <<" " <<max <<'\n';
  return 0;
}

C++: #include <iostream>
#include <string>
#include <cstdio>
#include <vector>
using namespace std;
int main(){
	int n[20],num,x,z,max=0;
	cin>>num;
	for(int i=1;i<=num;i++){
		cin>>x>>n[i];
		if(max<n[i]){
			max=n[i];
			z=i;
		}
	}
	cout<<z<<" "<<n[z]<<endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a[20],v[20],max=0,number,n;
  cin >>n;
  for(int i=0;i<n;i++){
    cin >>a[i]>>v[i];
    if(max<v[i]){
      max=v[i];
      number=i;}
  }
    cout <<a[number]<<" "<<v[number]<<endl;
    return 0;
  }

C++: #include <iostream>
#include <cstdio>

using namespace std;

typedef struct{
	int a;
	int v;
}member;

void swap(int *x, int *y){
	int temp=*x;
	*x=*y;
	*y=temp;
}

int main(){
	int n, max=0;
	member m[20];
	
	cin >> n;
	for(int i=0; i<n; ++i){
		scanf(" %d %d", &m[i].a, &m[i].v);		
		if(max < m[i].v) max=m[i].v;
	}
	
	for(int i=0; i<n; ++i){
		for(int j=i; j<n; ++j){
			if(m[i].v < m[j].v){
				swap(&m[i].a, &m[j].a);
				swap(&m[i].v, &m[j].v);
			}
		}
	}

	int count=0;
	for(int i=0; i<n; ++i)
		if(max==m[i].v) ++count;

	int index=0;
	for(int i=0; i<count; ++i)
		if(m[index].a > m[i].a) index = i;

	printf("%d %d\n", m[index].a, m[index].v);

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>

struct P {
    int x, y;
    bool operator<(const P& o) const {
        if (y == o.y) {
            return x < o.x;
        } else {
            return y > o.y;
        }
    }
};

using namespace std;

int main() {
    int n; cin >> n;
    vector<P> Ps;
    for (int i = 0; i < n; i++) {
        P p; cin >> p.x >> p.y;
        Ps.push_back(p);
    }
    sort(Ps.begin(), Ps.end());
    cout << Ps[0].x << ' ' << Ps[0].y << endl;
    return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define int long long
#define FILE_IO freopen("input.txt","r",stdin)/#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

const int MOD = 1e9 + 7;
const int INF = 1000000000;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 

using p = pair<int, int>;

bool cmp(p a, p b){
  return a.s < b.s;	
}

void solve(){
   int n;
   cin >> n;
   vector<p> v;
   
   for (int i = 0; i < n; i++){
	     int a, b;
	     cin >> a >> b;
	     v.push_back({-b, a});
	 }
   sort(all(v));
   cout << v[0].s <<  " " << -v[0].f << endl;
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}