func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 200000 + 10;   struct Tree {     int tl, tr;     int mx;   } tree[maxn << 2];   set<int> st[maxn];   int ve[maxn], n, m;   void build(int id, int l, int r) {     tree[id].tl = l;     tree[id].tr = r;     tree[id].mx = -1;     if (l == r) return;     int mid = (l + r) >> 1;     build(id << 1, l, mid);     build(id << 1 | 1, mid + 1, r);   }   void update(int id, int pos, int val, int y) {     int l = tree[id].tl, r = tree[id].tr;     if (l == r) {       if (st[pos].size())         tree[id].mx = *(--st[pos].end());       else         tree[id].mx = -1;       return;     }     int mid = (l + r) >> 1;     if (pos <= mid)       update(id << 1, pos, val, y);     else       update(id << 1 | 1, pos, val, y);     tree[id].mx = max(tree[id << 1].mx, tree[id << 1 | 1].mx);   }   int query(int id, int ql, int qr, int y) {     int l = tree[id].tl, r = tree[id].tr;     if (tree[id].mx <= y || ql > qr) {       return -1;     }     int mid = (l + r) >> 1;     if (l == r) return l;     if (qr <= mid)       return query(id << 1, ql, qr, y);     else if (ql > mid)       return query(id << 1 | 1, ql, qr, y);     else {       int tmp = query(id << 1, ql, mid, y);       if (tmp != -1) return tmp;       return query(id << 1 | 1, mid + 1, qr, y);     }   }   struct Point {     int x, y;     char op[5];     void init() { scanf( %s%d%d , op, &x, &y); }   } q[maxn];   int main() {     int n;     scanf( %d , &n);     for (int i = 1; i <= n; i++) {       q[i].init();       ve[i] = q[i].x;     }     sort(ve + 1, ve + 1 + n);     int m = unique(ve + 1, ve + 1 + n) - (ve + 1);     build(1, 1, m);     for (int i = 1; i <= n; i++) {       int pos = lower_bound(ve + 1, ve + 1 + m, q[i].x) - ve;       if (q[i].op[0] ==  a ) {         st[pos].insert(q[i].y);         update(1, pos, 1, q[i].y);       } else if (q[i].op[0] ==  r ) {         st[pos].erase(q[i].y);         update(1, pos, 1, q[i].y);       } else {         int ans = query(1, pos + 1, m, q[i].y);         if (ans == -1)           printf( -1 n );         else           printf( %d %d n , ve[ans], *st[ans].upper_bound(q[i].y));       }     }     return 0;   }   