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 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;
  while(cin >> a >> v){
    m[a] += v;
  }
  int ma = 0;
  REP(i,1,n+1){
    if(ma < m[i]){
      a = i;
      ma = m[i];
    }
  }
  cout << a << " " << ma << endl;
  return 0;
}

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

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

C++: #include <iostream>
#include <cstdlib>
#include <climits>

using namespace std;

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

  int maxv = INT_MIN;
  int winner;
  for( int i = 0; i < n; i++ ) {
    int a, v;
    cin >> a >> v;
    if( maxv <= v ) {
      winner = min( a, winner );
      maxv = v;
    }
  }
  cout << winner << " " << maxv << endl;

  return EXIT_SUCCESS;
}

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

int main() {
	
	int n;
	int p[20]={};
	int a,v;
	int max=0;
	
	cin>>n;
	for(int i=0;i<n;++i){
		cin>>a>>v;
		
		p[a-1] = v;
		if(v>max)max=v;
	}
	
	for(int i=0;i<n;++i){
		if(p[i]==max){
			cout<<i+1<<" "<<p[i]<<endl;
			break;
		}
	}
	
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n,a[21],b[101],i,z,zz,max;
	max=-1;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d",&a[n],&b[n]);
		if(b[n]>max){
			max=b[n];
			z=a[n];
		}
		if(max==b[n]){
			if(z<a[n]){
			z=z;
			}
			else if(z>a[n]){
			z=a[n];
			}
		}
	}
	printf("%d %d\n",z,max);
	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 = -1;
  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<algorithm>
#include<vector>

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

bool cmp(const P& a,const P& b)
{
  if(a.first == b.first)
    return a.second < b.second;
  return a.first > b.first;
}

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

C++: #include<stdio.h>
int main(void)
{
	int a,s,d,f,g,i;
	f=0;
	g=0;
	scanf("%d",&a);
	for(i=1;i<=a;i++){
		scanf("%d %d",&s,&d);
		if(f==d){
			if(g>s){
				g=s;
			}
		}
		else if(f<d){
			f=d;
			g=s;
		}
	}
	printf("%d %d\n",g,f);
	return 0;
}

C++: #include<iostream>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

int main() {
  int n;
  cin >> n;
  int ra = 1000, rb = -1;
  rep (i, n) {
    int a, b;
    cin >> a >> b;
    if (rb < b || (rb == b && ra > a)) {
      ra = a;
      rb = b;
    }
  }
  cout << ra << " " << rb << endl;
  return 0;
}

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

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

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

int main(){
	int person[20], fish[20];
	int n;
	int array[20];

	cin >> n;
	for(int i=0; i < n; i++){
		cin >> person[i] >> fish[i];
		array[i] = fish[i];
	}
	sort(array, array+n, greater<int>());

	for(int i=0; i < n; i++){
		if(array[0] == fish[i]){
			cout << person[i] << " " << fish[i] << endl;
		}
	}




}

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

typedef pair<int, int> P;

int main(){
  vector<P> v;
  int n;
  cin >> n;
  P t;
  for(int i = 0 ; i < n ; i++){
    cin >> t.second >> t.first;
    v.push_back(t);
  }

  sort(v.rbegin(), v.rend());
  cout << v[0].second << ' ' << v[0].first << endl;
  return 0;
}