#include <bits/stdc++.h>
using namespace std;
double (int,int);
int n,m,elevation;
int main(){
  cin>> n >> m;
  //elevation//
  vector<int>v= {a1,a2,a3,a4,....,an};
  for(i=0;i<=an;++i){
  cin>>elevation;
  }
for(i=1;i<=n;++i){
  cin>> a >>" ">> b;
  //take the input//
}
if(a=max(v)){
  cout<<v<<endl;
}
}