#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct node
{
int l,r,val;
node()
{
l=r=val=0;
}
};
vector<node> v(1);
int build(int s,int e)
{
int p=v.size();
v.push_back(node());
if(s==e)
return p;
int mid=(s+e)/2;
int left=build(s,mid);
int right=build(mid+1,e);
v[p].l=left;
v[p].r=right;
return p;
}
int main()
{
const int n = 100000 ;
int r=build(1,n);
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKCnN0cnVjdCBub2RlCnsKICAgIGludCBsLHIsdmFsOwogICAgbm9kZSgpCiAgICB7CiAgICAgICAgbD1yPXZhbD0wOwogICAgfQp9OwoKdmVjdG9yPG5vZGU+IHYoMSk7CgppbnQgYnVpbGQoaW50IHMsaW50IGUpCnsKICAgIGludCBwPXYuc2l6ZSgpOwogICAgdi5wdXNoX2JhY2sobm9kZSgpKTsKICAgIGlmKHM9PWUpCiAgICAgICAgcmV0dXJuIHA7CiAgICBpbnQgbWlkPShzK2UpLzI7CiAgICBpbnQgbGVmdD1idWlsZChzLG1pZCk7CiAgICBpbnQgcmlnaHQ9YnVpbGQobWlkKzEsZSk7CiAgICB2W3BdLmw9bGVmdDsKICAgIHZbcF0ucj1yaWdodDsKICAgIHJldHVybiBwOwp9CgoKaW50IG1haW4oKQp7CiAgICBjb25zdCBpbnQgbiA9IDEwMDAwMCA7CiAgICBpbnQgcj1idWlsZCgxLG4pOwogICAgcmV0dXJuIDA7Cn0K