// Cartesian tree
// Basic version implementing a set
// Added tFind
// #define _GLIBCXX_DEBUG 1
#include <bits/stdc++.h>
using namespace std;

struct Node
{
	int x;
	int y;
	Node* left;
	Node* right;
	
	Node (int x_) : x (x_), y ((rand() << 15) | rand()),
	                left (nullptr), right (nullptr)
	{}
};

pair <Node*, Node*> tSplit (Node* t, int x)
{
	if (t == nullptr) return {nullptr, nullptr};
	if (t->x >= x)
	{
		auto temp = tSplit (t->left, x);
		t->left = temp.second;
		return {temp.first, t};
	}
	else
	{
		auto temp = tSplit (t->right, x);
		t->right = temp.first;
		return {t, temp.second};
	}
}

Node* tMerge (Node* l, Node* r)
{
	if (l == nullptr) return r;
	if (r == nullptr) return l;
	if (l->y > r->y)
	{
		l->right = tMerge (l->right, r);
		return l;
	}
	else
	{
		r->left = tMerge (l, r->left);
		return r;
	}
}

Node * tInsert (Node* t, int x)
{
	pair <Node*, Node*> temp = tSplit (t, x);
	Node* v = new Node (x);
	Node* half = tMerge (temp.first, v);
	return tMerge (half, temp.second);
}

Node * tRemove (Node* t, int x)
{
	pair <Node*, Node*> one = tSplit (t, x);
	pair <Node*, Node*> two = tSplit (one.second, x + 1);
	// todo: delete
	return tMerge (one.first, two.second);
}

bool tFind (Node* t, int x)
{
	if (t == nullptr) return false;
	if (x == t->x) return true;
	if (x < t->x) return tFind (t->left, x);
	return tFind (t->right, x);
}

void tPrintRecur (Node* t)
{
	if (t == nullptr) return;
	cout << "(";
	tPrintRecur (t->left);
	cout << t->x << "";
	tPrintRecur (t->right);
	cout << ")";
}

void tPrint (Node* t)
{
	tPrintRecur (t);
	cout << endl;
}

int main ()
{
	int limit;
	cin >> limit;
	srand(time(nullptr));
	Node* root = nullptr;
	for (int i = 1; i <= limit; i += 2)
	{
		root = tInsert (root, i);
//		tPrint (root);
	}
//	tPrint (root);
	for (int i = 1; i <= limit; i++)
	{
		cout << i << ": " << tFind (root, i) << endl;
//		tPrint (root);
	}
	tPrint (root);
}
