#include <iostream>
#include <set>
using namespace std;

struct node {
  int i, j, val;
};

struct my_comparator {
  bool operator()(const node& a, const node& b) {
    return a.val < b.val;
  }
};

int main() {
  set<node, my_comparator> S;
  S.insert({1,23,4});
  S.insert({3,41,1});
  S.insert({2,12,2});
  
  cout << (*S.lower_bound({0, 0, 2})).val << endl;
  
}