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 <cstdio>
#include <cctype>
#include <utility>
#include <climits>
#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() {
	pair<int, int> m = {0, INT_MIN}, t;
	for (int n = in(); n; n--) {
		int a = -in();
		t = {in(), a};
		m = max(m, t);
	}
	outl(-m.second, ' ', m.first);
}

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

int main()
{
  int n,a,v,maxa=-1,maxv=-1;

  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a>>v;
    if(maxv<v){
      maxa=a;
      maxv=v;
    }
  }
  cout<<maxa<<" "<<maxv<<endl;
  return 0;
}

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

double dp[2001][2001];

int main(){
	int N,A,B,ans1,ans2=0;
	cin>>N;
	for(int i=0;i<N;i++){
		cin>>A>>B;
		if(B>ans2){
			ans1 = A; ans2 = B;
		}
	}
	printf("%d %d\n",ans1,ans2);
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
double N;
ll M;
string s;
vector<ll > input1;  
vector<vector <ll > > input2;

int main(){
    
    int n = 0;
    cin >> n;
    vector<pair <int, int > > result;
    int s, t; 
    for(int i = 0; i < n; i++){
        cin >> s >> t;
        result.push_back(make_pair(t, s));
    }

    sort(result.rbegin(), result.rend());

    int temp = result[0].first;
    int number = result[0].second;
    for(int i = 0; i < n; i++){
        if(temp == result[i].first){
            number = result[i].second;
        }else{
            break;
        }
    }

    cout << number <<  " " << result[0].first << endl;



}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit
#include <cstdio>	// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>	// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define DEBUG 0

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
string FILE_NAME = "testcase.0095_";
string NAME;
string itos (int n )
{
	stringstream ss;
	ss << n;

	return ss.str();
}

int main()
{
//	cut here before submit 
#if DEBUG
	NAME = FILE_NAME;
	int CNT = 1;
	NAME += itos (CNT );
	while (freopen (NAME.c_str() , "r", stdin ) != NULL ) {
#endif
	ios_base::sync_with_stdio(0);
	int n; cin >> n;
	vector<P> av(n );
	rep (i, n ){
		int a, v; cin >> a >> v;
		av[i].first = -v;
		av[i].second = a;
	} // end rep

	sort (ALL (av ) );

	cout << av[0].second << ' ' << -av[0].first << endl;

#if DEBUG
	CNT++;	// cut here before submit
	NAME = FILE_NAME;
	NAME += itos (CNT );
	} // end loop; cut here before submit
#endif			
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    int max=0; int kouho =0;
    int a,b;
    for(int i=0;i<n;i++){
        cin >> a >> b;
        if(max < b){
            max = b;
            kouho = a;
        }
    }
    cout << kouho << " " << max << endl;
}

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

using namespace std;
typedef pair<int,int> P;

int main(){
    int n,a,v;
    priority_queue<P,vector<P> > que;

    cin>>n;

    while(n--){
        cin>>a>>v;
        que.push(P(v,a));
    }

    v=que.top().first;
    a=que.top().second;
    que.pop();

    while(!que.empty() && que.top().first==v){
        a=min(a,que.top().second);
        que.pop();
    }

    cout<<a<<" "<<v<<endl;

    return 0;
}

C++: #include <bits/stdc++.h>

#define loop(v, f, l) for(int v = (f), v##_ = (l); v < v##_; ++v)

using namespace std;

typedef long long int lint;
static inline int in(){ int x; scanf("%d", &x); return (x); }
static inline lint inl(){ lint x; scanf("%lld", &x); return (x); }

int main()
{
	int n;
	int number;
	int getNum;
	int numOfGetFish[21];
	int winnerIndex;
	int maxFish = 0;

	scanf("%d", &n);
	while( scanf("%d%d", &number, &getNum) != EOF )
	{
		numOfGetFish[number - 1] += getNum;
	}
	loop(i, 0, n)
	{
		if( numOfGetFish[i] > maxFish )
		{
			winnerIndex = i + 1;
			maxFish = numOfGetFish[i];
		}
	}
	printf("%d %d\n", winnerIndex, maxFish);
	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;}
  else if(max==v[i] && a[i]<a[number]){
    number=i;}
  }
    cout <<a[number]<<" "<<v[number]<<endl;
    return 0;
  }

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

int main() {
  int n, a, v, ma, mv = -1;
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> a >> v;
    if(v > mv) {
      ma = a;
      mv = v;
    } 
    else if(v == mv && ma > a) {
      ma = a;
    }
  }
  cout << ma << ' ' << mv << endl;
}