#include<stdio.h>

typedef struct{
  int oya,sa,yuu;
}ki;

ki tree[100000];
int Depth[100000];
int Height[100000]
  
void depth(int r,int t){
  if(r==-1)return;_
  Depth[r]=t;
  if(tree[r].yuu!=-1)depth(tree[r].yuu,t+1);
  if(tree[r].sa!=-1)depth(tree[r].sa,t+1);
}

int setHeight(int u){
  int height1=0,height2=0;
  if(tree[u].sa!=-1)height1=setHeight(tree[u].sa)+1;
  if(tree[u].yuu!=-1)height2=setHeight(tree[u].yuu)+1;
  return Height[u]=(h1>h2 ? h1 : h2);
}

int get 

