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 <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int dx[8] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dy[8] = {0, -1, 0, 1, -1, 1, -1, 1};

int main() {
  int n;
  map<int, int> p;

  cin >> n;
  REP(i, n) {
    int x, y;
    cin >> x >> y;
    p.insert(MP(x, y));
  }
  int max = 0;
  map<int, int>::iterator ans;
  map<int, int>::iterator it = p.begin();
  while(it != p.end()) {
    if(max < it->second) {
      ans = it;
      max = it->second;  
    }
    it++;
  }
  cout << ans->first << ' ' << ans->second << endl;
}

C++: #include<vector>
#include<iostream>
using namespace std;
int main(){
	int N,x,y,ans1,ans2=-1;
	cin >> N;
	while(N--){
		cin >> x >> y;
		if(y>ans2){
				ans1 = x;
				ans2 = y;
		}
	}
	cout << ans1 << ' ' << ans2 << endl;
	return 0;
}

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

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

int main(){
  int n,tmp,temp,cou=0;
  int i,j;
  int a[20],v[100];
  cin >> n;
  for(i=0;i<n;i++){
    cin >> a[i] >> v[i];
  }
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      if(v[i] < v[j]){
	temp = v[i];
	v[i] = v[j];
	v[j] = temp;
	tmp = a[i];
	a[i] = a[j];
	a[j] = tmp;
      }
    }
  }
  tmp = v[i];
  for(i=1;i<n;i++){
    if(tmp == v[i]){
      cou++;
    }
  }
  if(cou != 0){
    sort(a,a+cou);
  }
  cout << a[0] << " " << v[0] << endl;
}

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

int main(){
  int n,max=0,maxi=0,num,rec;
  cin >> n;
  for(int i=0;i<n;i++){
    scanf(" %d %d",&num,&rec);
    if(rec>max){
      max=rec;
      maxi=num;
    } else if(rec==max){
      if(maxi>num){
	maxi=num;
      }
    }
  }
  cout << maxi << " " << max << endl;  
  return(0);
}

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


int main(){
    int n;
    cin>>n;

    vector<pair<int,int> >vec;

    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        vec.push_back(pair<int,int>(-b,a));
    }

    sort(vec.begin(),vec.end());
    cout<<vec[0].second<<" "<<-vec[0].first<<endl;
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    // Your code here!
    ll n;
	cin>>n;
	ll a[n],b[n];
	vector<pair<ll, ll> > ab(n);
	for(ll i=0;i<n;i++)cin>>a[i]>>b[i];
	for(int i=0;i<n;i++){
		ab[i] = make_pair(b[i],a[i]);
	}
	sort(ab.begin(),ab.end());
	int mi=101;
	for(int i=0;i<n;i++){
	    if(ab[i].first==ab[n-1].first){
	        if(mi>ab[i].second)mi=ab[i].second;
	    }
	}
	cout<<mi<<" "<<ab[n-1].first<<endl;
}

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(), at = -in();
	pair<int, int> m = {in(), at}, t;
	while (n--) {
		int a = -in();
		t = {in(), a};
		m = max(m, t);
	}
	outl(-m.second, ' ', m.first);
}

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

int main ()
{
    int n;
    cin >> n;
    vector <pair<int,int> > V;
    for (int i = 0; i <= n; i++) {
        V.push_back(pair<int,int>(0,i));
    }
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        V[a].first += b;
    }
    sort(V.begin(), V.end());
    int i = 1;
    while (V[i].first != V[n].first) i++;
    for (; i <= n; i++) {
        cout << V[i].second << " " << V[i].first << endl;
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

main(){
  int n, a, b, m = 0, d;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a >> b;
    if(m < b){
      m = b;
      d = a;
    }
  }
  cout << d << ' ' << m << endl;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;
int main(){
	
	int n;
	cin>>n;
	int maxa,maxb;
	
	int a,b;
	
	cin>>a>>b;
	
	maxa=a;
	maxb=b;
	
	for(int i=1;i<n;i++){
		cin>>a>>b;
		if(maxb<b){
			maxb=b;
			maxa=a;
		}
	}
	
	cout<<maxa<<" "<<maxb<<endl;
	



}

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

typedef pair<int,int> P;

int main(){
    int n;
    cin>>n;
    vector<P> data;
    for(int i=0; i<n; i++) {
        int a, v;
        cin>>a>>v;
        data.push_back(P(-v,a));
    }
    sort(data.begin(),data.end());
    cout<<data[0].second<<" "<<-data[0].first<<endl;
}