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 <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define REPR(i,n) for (int i=(int)(n)-1;i>=0;--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
#define tpl(...) make_tuple(__VA_ARGS__)
const int INF = 0x3f3f3f3f;
const double EPS = 1e-8;
const double PI = acos(-1);
const int dy[] = {-1,0,1,0};
const int dx[] = {0,1,0,-1};
typedef long long ll;
typedef pair<int,int> pii;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename Ch,typename Tr,typename C,typename=decltype(begin(C()))>basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>&os,
const C& c){os<<'[';for(auto i=begin(c);i!=end(c);++i)os<<(i==begin(c)?"":" ")<<*i;return os<<']';}
template<class S,class T>ostream&operator<<(ostream &o,const pair<S,T>&t){return o<<'('<<t.first<<','<<t.second<<')';}
template<int N,class Tp>void output(ostream&,const Tp&){}
template<int N,class Tp,class,class ...Ts>void output(ostream &o,const Tp&t){if(N)o<<',';o<<get<N>(t);output<N+1,Tp,Ts...>(o,t);}
template<class ...Ts>ostream&operator<<(ostream&o,const tuple<Ts...>&t){o<<'(';output<0,tuple<Ts...>,Ts...>(o,t);return o<<')';}
template<class T>void output(T t,char z=10){if(t<0)t=-t,putchar(45);int c[20];
int k=0;while(t)c[k++]=t%10,t/=10;for(k||(c[k++]=0);k;)putchar(c[--k]^48);putchar(z);}
template<class T>void outputs(T t){output(t);}
template<class S,class ...T>void outputs(S a,T...t){output(a,32);outputs(t...);}
template<class T>void output(T *a,int n){REP(i,n)cout<<a[i]<<(i!=n-1?',':'\n');}
template<class T>void output(T *a,int n,int m){REP(i,n)output(a[i],m);}
template<class T>bool input(T &t){int n=1,c;for(t=0;!isdigit(c=getchar())&&~c&&c-45;);
if(!~c)return 0;for(c-45&&(n=0,t=c^48);isdigit(c=getchar());)t=10*t+c-48;t=n?-t:t;return 1;}
template<class S,class ...T>bool input(S&a,T&...t){input(a);return input(t...);}
template<class T>bool inputs(T *a, int n) { REP(i,n) if(!input(a[i])) return 0; return 1;}

int main() {
  int n;
  cin >> n;
  pii ans;
  REP(i,n) {
    int a,b;
    cin >> a >> b;
    chmax(ans, pii(b,-a));
  }
  cout << -ans.second << " " << ans.first << endl;
}

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

typedef std::pair<int,int> P;

bool compare( const P& lhs, const P& rhs )
{
	if( lhs.first != rhs.first )
		return lhs.first > rhs.first;

	return lhs.second < rhs.second;
}

int main()
{
	int n;
	std::cin >> n;
	
	std::vector<P> vec;
	while( n-- )
	{
		int a, v;
		std::cin >> a >> v;
		vec.push_back( std::make_pair( v, a ) );
	}

	std::sort( vec.begin(), vec.end(), compare );

	std::cout << vec[0].second << " " << vec[0].first << std::endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int n,a,v;
  int ansa=0,ansv=0;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a >> v;
    if(ansv<v){
      ansa = a;
      ansv = v;
    }
  }
  cout << ansa << ' ' << ansv << endl;
  return 0;
}

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

int main() 
{
	map<int, int>s;
	int a;
	cin >> a;
	for (int b = 0; b < a; b++) {
		int c, d;
		cin >> c >> d;
		if (s[d] < c)s[d] = c;
	}
	auto e = s.end();
	e--;
	cout << e->second << " " << e->first << endl;
}

C++: #include<iostream>
using namespace std;
int main(){

	int n;
	int fish[20] = { 0 };
	int ans1 = -1;
	int ans2;
	int num;

	cin >> n;

	for (int i = 0; i < n; i++){
		cin >> num;
		cin >> fish[num - 1];
	}

	for (int i = 0; i < n; i++){
		if (fish[i] > ans1){
			ans2 = 0;
			ans1 = fish[i];
			ans2 = i + 1;
		}
	}

	cout << ans2 << " " << ans1 << endl;

	return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  map<int,int> m;
  int n;
  cin >> n;
  rep(i,n){
    m[i+1] = 0;
  }
  int a,v;
  rep(i,n){
    cin >> a >> v;
    m[a] = v;
  }
  int ma = 0;
  REP(i,1,n+1){
    if(ma < m[i]){
      a = i;
      ma = m[i];
    }
//     cout << i << " " << m[i]<<endl;
  }
  cout << a << " " << ma << endl;
  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

int main() {
	lint N;
	cin >> N;
	vector<pair<lint, lint>>A(N);
	rep(i, N) {
		cin >> A[i].second >> A[i].first;
	}
	rep(i, N) {
		A[i].second *= -1;
	}
	sort(A);
	cout << A[N - 1].second * (-1) << ' ' << A[N-1].first << endl;
}

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

int main() {
  int n;
  pair<int,int> ans(1,0);
  cin >> n;
  while(n--) {
    int a, v;
    cin >> a >> v;
    ans = min(ans, make_pair(-v, a));
  }
  cout << ans.second << " " << -ans.first << endl;
  return 0;
}