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>

using namespace std;

int p[20];
int fish[20];

void buble_sort(int n){

  for( int i = 0 ; i < n - 1 ; i++ ){
    for( int j = n - 1 ; j > i ; j-- ){
      if( fish[j-1] > fish[j] ){

	int temp1 = fish[j];
	fish[j] = fish[j-1];
	fish[j-1] = temp1;

	int temp2 = p[i];
	p[j] = p[j-1];
	p[j-1] = temp2;

      }
    }
  }


}

int main(void){

  int n;

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

  buble_sort(n);

  for( int i = 0 ; i < n; i++ )cout << p[i] << "---" << fish[i] << endl;

  for( int i = n - 1 ; i > 0 ; i-- ){
    if( fish[i] != fish[i-1] ){
      cout << p[i] << " " << fish[i] << endl;
      return 0;
    }
    if( i == 1 ){
      if( fish[1] == fish[0] )cout << p[0] << " " << fish[0] << endl;
      else cout << p[1] << " " << fish[1] << endl;
    }
  }
}

C++: #include<iostream>
#include<map>
#include<algorithm>
using namespace std;
typedef pair < int , int > Pi;
int main(){
  int n;
  Pi a[20];
  cin >> n;
  for(int i = 0 ; i < n ; i++ ){
    cin >> a[i].second >> a[i].first;
  }

  int no = -1, big = -1;
  for(int i = 0 ; i < n ; i++ ){
    if(big < a[i].first) big = a[i].first, no = a[i].second;
    else if(big == a[i].first && no > a[i].second) no = a[i].second;
  }
  cout << no << " " << big << endl;
}

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

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

int main(){

	int n;
	int fish[20] = { 0 };
	int ans1 = 0;
	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<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",z,max);
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n[20],num,x,z,max=0;
	cin>>num;
	for(int i=0;i<num;i++){
		cin>>x>>n[x];
		if(max<n[x]){
			max=n[x];
			z=x;
		}
	}
	cout<<z<<" "<<n[z]<<endl;
	return 0;
}

C++: #include <cstdio>
#include <algorithm>

using namespace std;

int main(){
	int n;
	int a, b;
	int v[110] = {0}, v2[110] = {0};
	
	scanf("%d", &n);
	
	for (int i = 1; i <= n; i++){
		scanf("%d %d", &a, &b);
		v[a] = b;
		v2[a] = b;
	}
	
	sort(v, v + n);
	reverse(v, v + n);
	
	for (int i = 0; i < n; i++){
		if (v2[i] == v[0]){
			printf("%d %d\n", i, v2[i]);
			break;
		}
	}
}

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

C++: #include<stdio.h>
int main()
{
	int n;
	int a[20],v[20],max=0,mv=20;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d %d",&a[i],&v[i]);
	}
	for(int i=0;i<n;i++){
		if(v[i]>max){
			if((i<mv)||v[i]!=max){
				max=v[i];
				mv=a[i];
			}
		}
	}
	printf("%d %d\n",mv,max);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,men,fish,num,fishmax;
    cin>>n;
    for(int i=0;i<n;i++){
    cin>>men>>fish;
    if(i==0){
        num=men;
        fishmax=fish;
    }
    else {
        if(fish>fishmax){
            fishmax=fish;
            num=men;
        }
        else if(num>men&&fish==fishmax)num=men;
    }
   }
   cout<<num<<" "<<fishmax<<endl;
}

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

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

void solve()
{
	int n;
	cin >> n;
	vector<p> list(n);
	for(int i = 0; i < n; ++i)
	{
		cin >> list[i].second >> list[i].first;
	}
	sort(list.begin(), list.end());
	cout << list[n - 1].second << " " << list[n - 1].first << endl;
}

int main()
{
	solve();
	return(0);
}

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

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

		return 0;
}

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

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

		return 0;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int N;
vp a;

int main(){
	cin>>N;
	a=vp(N);
	int num,v;
	for(int i=0;i<N;i++){
		cin>>num>>v;
		a[i]=P(v,-num);
	}
	sort(a.begin(),a.end());
	P ans=a.back();
	cout<<-ans.second<<' '<<ans.first<<endl;
	
}

C++: #include<stdio.h>
int fish[21]={0};
int n;
int a,b;
int memo[2]={0};

int main()
{
    scanf("%d",&n);
    memo[0]=1;
    for(int i=0;i<n;i++)
    {
        scanf("%d%d",&a,&b);
        fish[a] +=b;
    }
    for(int i=0;i<20;i++)
    {
        if(fish[i]>memo[1])
        {
            memo[0]=i;
            memo[1]=fish[i];
        }
    }
    printf("%d %d\n",memo[0],memo[1]);
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[2]={-1,-1};
	for(int i=0;i<n;i++){
		int b,c;
		cin>>b>>c;
		if(c==a[1])
			a[0]=min(a[0],b);
		if(c>a[1]){
			a[0]=b;
			a[1]=c;
		}
	}
	cout<<a[0]<<" "<<a[1]<<endl;
}

C++: #include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int n;
  pair<int,int> num[105];
  int i;

  cin>>n;

  rep(i,n){
    cin>>num[i].second>>num[i].first;
    num[i].first*=-1;
  }
  sort(num,num+n);
  cout<<num[0].second<<" "<<-num[0].first<<endl;

}