#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c2V0Pgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IG5vZGUgewogIGludCBpLCBqLCB2YWw7Cn07CgpzdHJ1Y3QgbXlfY29tcGFyYXRvciB7CiAgYm9vbCBvcGVyYXRvcigpKGNvbnN0IG5vZGUmIGEsIGNvbnN0IG5vZGUmIGIpIHsKICAgIHJldHVybiBhLnZhbCA8IGIudmFsOwogIH0KfTsKCmludCBtYWluKCkgewogIHNldDxub2RlLCBteV9jb21wYXJhdG9yPiBTOwogIFMuaW5zZXJ0KHsxLDIzLDR9KTsKICBTLmluc2VydCh7Myw0MSwxfSk7CiAgUy5pbnNlcnQoezIsMTIsMn0pOwogIAogIGNvdXQgPDwgKCpTLmxvd2VyX2JvdW5kKHswLCAwLCAyfSkpLnZhbCA8PCBlbmRsOwogIAp9