#include <iostream>
#include <random>

using namespace std;

random_device rd;
mt19937 rng(rd());

template<typename T>
struct Treap {
	Treap<T>* left;
	Treap<T>* right;
	T x;
	unsigned int y;
	unsigned int size;

	Treap(T n = 0) {
		x = n;
		y = rng();
		left = nullptr;
		right = nullptr;
		size = 1;
	}

	void update() {
		size = 1;
		if (left != nullptr) size += left->size;
		if (right != nullptr) size += right->size;
	}

	unsigned int get_size() {
		if (this == nullptr) return 0;
		return size;
	}

	Treap<T>* find(T xs) {
		if (this == nullptr) return nullptr;
		if (x == xs) return this;
		if (xs < x) {
			return left->find(xs);
		}
		if (xs > x) {
			return right->find(xs);
		}
	}
};

template<typename T>
pair<Treap<T>*, Treap<T>*> split(Treap<T>* root, T xs) { // слева <=
	if (root == nullptr) return make_pair(nullptr, nullptr);
	if (root->x <= xs) { // корень слева
		if (root->right == nullptr) return make_pair(root, nullptr);
		auto res = split(root->right, xs); // разбить правое поддерево
		root->right = res.first;
		root->update();
		return make_pair(root, res.second);
	}
	else { // корень справа
		if (root->left == nullptr) return make_pair(nullptr, root);
		auto res = split(root->left, xs); // разбить левое поддерево
		root->left = res.second;
		root->update();
		return make_pair(res.first, root);
	}
}

template<typename T>
pair<Treap<T>*, Treap<T>*> split_k(Treap<T>* root, unsigned int k) { // слева k
	if (root == nullptr) return make_pair(nullptr, nullptr);
	if (root->left->get_size() < k) { // корень слева
		if (root->right == nullptr) return make_pair(root, nullptr);
		auto res = split_k(root->right, k - root->left->get_size() - 1); // разбить правое поддерево
		root->right = res.first;
		root->update();
		return make_pair(root, res.second);
	}
	else { // корень справа
		if (root->left == nullptr) return make_pair(nullptr, root);
		auto res = split_k(root->left, k); // разбить левое поддерево
		root->left = res.second;
		root->update();
		return make_pair(res.first, root);
	}
}

template<typename T>
Treap<T>* merge(Treap<T>* first, Treap<T>* second) {
	if (first == nullptr) return second;
	if (second == nullptr) return first;
	if (first->y > second->y) {
		first->right = merge(first->right, second);
		first->update();
		return first;
	}
	else {
		second->left = merge(first, second->left);
		second->update();
		return second;
	}
}

template<typename T>
Treap<T>* insert(Treap<T>* root, T x) {
	auto res = split(root, x);
	Treap<T>* tx = new Treap<T>(x);
	return merge(merge(res.first, tx), res.second);
}

template<typename T>
Treap<T>* erase(Treap<T>* root, T x) {
	auto res = split(root, x);
	auto left_res = split(res.first, x - 1);
	return merge(left_res.first, res.second);
}

template<typename T>
pair<Treap<T>*, Treap<T>*> kth_element(Treap<T>* root, unsigned int k) {
	if (root->get_size() < k) return make_pair(nullptr, root);
	auto res = split_k(root, k + 1);
	auto left_res = split_k(res.first, k);
	return make_pair(left_res.second, merge(left_res.first, merge(left_res.second, res.second)));
}

void interact() {
	Treap<int>* root = nullptr;
	while (true) {
		char ch;
		cin >> ch;

		if (ch == 'i') {
			int x;
			cin >> x;
			root = insert(root, x);
		}
		if (ch == 'e') {
			int x;
			cin >> x;
			root = erase(root, x);
		}
		if (ch == 'f') {
			int x;
			cin >> x;
			if (root->find(x) != nullptr) cout << '+' << endl;
			else cout << '-' << endl;
		}
		if (ch == '?') {
			int k;
			cin >> k;
			auto res = kth_element(root, k);
			root = res.second;
			if (res.first == nullptr) cout << "no" << endl;
			else cout << res.first->x << endl;
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	interact();

	return 0;
}
