#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(v) \
cerr << "Line(" << __LINE__ << ") -> " << #v << " = " ;
#define dbx(x) debug(x); cerr << x << "\n";
#define dbg(x) debug(x); cerr << "{ "; for(auto &e : x) cerr << e << ", "; cerr << "} \n";
// Code
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T> using o_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const ll N = 1e6+10, MOD = (ll)1e9+7, OO = (ll)1e17+10;
void solve(){
o_set<int>se;
se.insert(1);
se.insert(2);
cout << *se.find_by_order(0) << endl; ///k th element
cout << se.order_of_key(2) << endl; ///number of elements less than k
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
ll tc = 1; // cin >> tc;
for(int t = 1 ; t <= tc ; t ++){
solve();
}
return 0;
}
/*
*/
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwojZGVmaW5lIGRlYnVnKHYpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICBjZXJyIDw8ICJMaW5lKCIgPDwgX19MSU5FX18gPDwgIikgLT4gIiA8PCAjdiA8PCAiID0gIiA7IAojZGVmaW5lIGRieCh4KSBkZWJ1Zyh4KTsgY2VyciA8PCB4IDw8ICJcbiI7CiNkZWZpbmUgZGJnKHgpIGRlYnVnKHgpOyBjZXJyIDw8ICJ7ICI7IGZvcihhdXRvICZlIDogeCkgY2VyciA8PCBlIDw8ICIsICI7IGNlcnIgPDwgIn0gXG4iOwoKLy8gQ29kZQojaW5jbHVkZTxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KI2luY2x1ZGU8ZXh0L3BiX2RzL3RyZWVfcG9saWN5LmhwcD4KdXNpbmcgbmFtZ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