/*
#include <stdio.h>
typedef struct treeNode {
int size;
struct treeNode *left, *right;
}treeNode;
treeNode* createNode(int size, treeNode* left, treeNode* right)
{
treeNode *root=(treeNode*)malloc(sizeof(treeNode));
root->size=size;
root->left=left;
root->right=right;
return root;
}
*/
/* 1936
int dis(int a, int b)
{
if(a==b) return 0;
if(a>b) return dis(a/2, b)+1;
if(a<b) return dis(a, b/2)+1;
}
int main()19
1 2 3
2 4 5
3 6 7
4 8 -1
5 9 10
6 11 12
7 13 -1
8 -1 -1
9 14 15
10 -1 -1
11 16 -1
12 -1 -1
13 17 -1
14 -1 -1
15 18 -1
16 -1 -1
17 -1 19
18 -1 -1
19 -1 -1
{
int a, b;
scanf("%d %d", &a, &b);
printf("%d", dis(a, b));
return 0;
}
*/
/* 4497
#include <stdio.h>
int main()
{
int i, n, left, right;
scanf("%d", &n);
for(i=0;i<n;i++) {
scanf("%d %d %d", &i+1, &left, &right);
}
printf("%d %d", );
}
*/
/* 4868
#include <stdio.h>
int main()
{
int i, n, q, x, a, b, c, d;
scanf("%d %d", &n, &q);
for(i=0;i<n-1;i++) {
scanf("%d", &a);
}
for(i=0;i<n+q-1;i++) {
scanf("%d", &x);
if(x==0) {
scanf("%d", &b);
}
else if(x==1) {
scanf("%d %d", &c, &d);
}
}
}
*/
/* 4714
#include <stdio.h>
int main()
{
int i, n, m, a, b;
scanf("%d", &n);
scanf("%d", &m);
for(i=0;i<m;i++) {
scanf("%d %d", &a, &b);
}
}
*/