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 <utility>
#include <algorithm>
#include <vector>
using namespace std;

typedef pair<int, int> P;

int main(){
    int n;
    cin >> n;
    int m_a , m_v = 0, a, v;
    for(int i = 0; i < n; i++){
        cin >> a >> v;
        if( v > m_v || (v == m_v && a < m_a )){
            m_v = v;
            m_a = a;
        }
    }
    cout << m_a << ' ' << m_v << endl;
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef pair<int, int>P;

map<int, int>mp;
int main() {
	int n; cin >> n;
	rep(i, n) {
		int a, v; cin >> a >> v;
		mp[a] += v;
	}
	vector<P>V;
	for (P i : mp)V.push_back(i);
	stable_sort(V.begin(), V.end(), [](P a, P b) {return a.second > b.second; });
	cout << V[0].first << ' ' << V[0].second << endl;
}

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

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

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){
		if(max==m[i].v){
			printf("%d %d\n", m[i].a, m[i].v);
			break;
		}
	}

	return 0;
}

C++: #include <iostream>
int main(void){
  int n,a,b,max=0,c=21;
  std::cin>>n;
  for(int i=0;i<n;i++){
    std::cin>>a>>b;
    if(max<=b){
      max=b;
      if(c>a)c=a;
    }
  }
  std::cout<<c<<" "<<max<<'\n';
  return 0;
}

C++: #include<iostream>
int main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";}

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

int main(){

  int n;
  int a,b;
  int z[1000][1000] = {0};

  cin >> n;

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

  for(int i=100;i>=0;i--){
    for(int j=1;j<=20;j++){
      if(z[i][j] == 1){
	cout << j << " " << i << endl;
	return 0;
      }
    }
  }

}

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

int main()
{
    int n;
    int p[21] = {};

    cin >> n;

    int max = 0;
    for( int i = 1; i <= n; i++ )
    {
        int t;
        cin >> t >> p[t];
        if( max < p[t] )
            max = p[t];
    }
    
    int min = 1000;
    for( int i = 1; i <= n; i++ )
    {
        if( p[i] == max && i < min )
            min = i;
    }

    cout << min << " " << max;

    return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>
#include <complex>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template <class T> int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }

typedef long long ll;
typedef double D;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }




int main() {
	int n; cin >> n;
	
	int ans1 = 0, ans2 = 0;
	
	int a, b;
	for_(i, 0, n) {
		cin >> a >> b;
		if (ans2<b) {
			ans2 = b;
			ans1 = a;
		} else if (ans2==b) {
			ans1 = min(ans1, a);
		}
	}
	
	cout << ans1 << " " << ans2 << endl;
	
	return 0;
}

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

typedef pair<int, int> Pair;

int n;
int a, v;
Pair ans(-1, -1);

int main() {
  scanf("%d", &n);
  for (int i=0; i<n; i++) {
    scanf("%d%d", &a, &v);
    ans = max(ans, Pair(v, -a));
  }

  printf("%2$d %1$d\n", ans.first, -ans.second);
}

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

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	int n = in(), a = -in();
	pair<int, int> m = {in(), a}, t;
	while (--n) {
		a = -in();
		t = {in(), a};
		m = max(m, t);
	}
	outl(-m.second, ' ', m.first);
}