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

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

using _lint = int;
#define REP(i, n) for (_lint i = 0; i < (_lint)(n); i++)
#define FOR(i, a, b) for (_lint i = (_lint)(a); i < (_lint)(b); i++)
#define FORR(i, a, b) for (_lint i = (_lint)(b)-1; i >= (_lint)(a); i--)

#define CHMIN(a, b) (a) = min((a), (b))
#define CHMAX(a, b) (a) = max((a), (b))
#define ALL(v) (v).begin(), (v).end()

#define DEBUG(x) cerr << #x << ": " << (x) << endl
#define DEBUG_VEC(v)                                                           \
  {                                                                            \
    cerr << #v << ": ";                                                        \
    REP(__i, size(v)) cerr << ((v)[__i]) << ", ";                              \
    cerr << endl;                                                              \
  }

int main() {
  int ans = 1<<30;
  int n;
  cin>>n;
  REP(i,n) {
    int a,p,x;
    cin>>a>>p>>x;
    if(x>a) {
      CHMIN(ans, p);
    }
  }
  if(ans==(1<<30))ans=-1;
  cout<<ans<<endl;
  return 0;
}

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#include<iomanip>

using namespace std;

int main(){
    int n; cin >> n;
    pair<int, int> a[n];
    for(int i=0;i<n;i++) cin >> a[i].first >> a[i].second;

    for(int i=0;i<(n-1);i++){
        for(int j=i+1;j<n;j++){
            for(int k=0;k<n;k++){
                if(k == i || k == j) continue;
                else{
                    int x = (a[j].first - a[i].first) * (a[k].second - a[i].second);
                    int y = (a[j].second - a[i].second) * (a[k].first - a[i].first);
                    if(x == y){
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
            }
        }
    }

    cout << "No" << endl;
}