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++: #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;


int main ()
{
	int N;
	int ansa = 0 , ansb = -1;
	cin >> N;
	int a , b;
	for( size_t i = 0; i < N; i++ )
	{
		cin >> a >> b;
		if( b > ansb )
		{
			ansa = a;
			ansb = b;
		}
	}
	cout << ansa << " " << ansb << endl;
}

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

main(){
  int n;
  int a, b;
  int maxv = -1;
  int id = 21;

  set<int> I;
  cin >> n;

  for ( int i = 0; i < n; i++ ){
    cin >> a >> b;
    I.insert(a);
    if ( maxv == b ){
      if ( id > a ){
	maxv = b;
	id = a;
      }
    } else if ( maxv < b ){
      maxv = b;
      id = a;
    }
  }

  cout << id << " " << maxv << endl;
}

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

using namespace std;

int main()
{
  pair<int, int> perf[20], max;
  int i, n;

  cin >> n;
  for (i = 0; i < n; i++) {
	cin >> perf[i].first >> perf[i].second;
  }

  max = perf[0];
  for (i = 1; i < n; i++) {
    if ((max.second < perf[i].second) || 
        (max.second == perf[i].second && max.first > perf[i].first)) {
      max = perf[i];
    }
  }

  cout << max.first << " " << max.second << endl;

  return 0;
}

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

int main(void){

  int n;
  int max = -1;
  int num = 0;

  cin >> n;

  for( int i = 0 ; i < n ; i++ ){

    int a = 0,v = 0;

    cin >> a >> v;

    if( max < v ){
      
      max = v;
      num = a;

    }

  }

  cout << num << " " << max << endl;

  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 << a << " " << b << endl;
}

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::printf("%d %d\n",A,M); }

C++: // 2014/05/30 Tazoe

#include <iostream>
using namespace std;

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

	int a_max = 0;
	int v_max = -1;

	for(int i=0; i<n; i++){
		int a, v;
		cin >> a >> v;

		if(v>v_max || (v==v_max && a<a_max)){
			a_max = a;
			v_max = v;
		}
	}

	cout << a_max << ' ' << v_max << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-9;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
    int n;cin>>n;
    int ma=-1;int aa=INF;
    for(int i=0;i<n;i++){
        int a,v;cin>>a>>v;
        if(v>ma){
            aa=a;
            ma=v;
        }else if(v==ma){
            aa=min(aa,a);
        }
    }
    cout<<aa<<" "<<ma<<endl;
}

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

int main() {
	int n, nf, num , mnf = 0, mnum;

	cin >> n;
	while (n--) {
		cin >> num >> nf;
		if (nf > mnf) {
			mnf = nf;
			mnum = num;
		}
	}
		cout << mnum << " " << mnf << endl;

		return 0;
	}

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 a, v;
    cin >> a >> v;
    p.insert(MP(v, a));
  }

 
  map<int, int>::iterator it = p.end();  
  it--;
  map<int, int>::iterator ans = it;
  int max = it->first;
  while(max > it->first) {
    if(it->second > ans->second) ans = it;
    it--;
  }

  cout << ans->second << ' ' << ans->first << endl;
}

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

int main(void){

  int n;
  int max = 0;
  int num = 0;
  int flag = 0;

  cin >> n;

  for( int i = 0 ; i < n ; i++ ){

    int a = 0,v = 0;

    cin >> a >> v;

    if( max <= v && flag == 0){
      
      max = v;
      num = a;

      if( max == 0 ) flag = 1;

    }

  }

  cout << num << " " << max << endl;

  return 0;

}