#include<stdio.h>
??
struct intree{
????int parent;
????int left;
????int right;
????int key;
};
??
int size;
struct intree li[100000];

int parent1(int i){
??????return li[i/2].key;
}
??
int left1(int i){
????return li[2*i].key;
????
}
??
int right1(int i){
????return li[2*i+1].key;?? 
????
}
??
int main(void){
????int i,j;
??????
????scanf("%d",&si);
????for(i=1;i<=si;i++) scanf("%d",&li[i].key);
??????
??????
????for(i=1;i<=si;i++){
????????if(i!=1) li[i].parent=parent1(i);
????????else?? li[i].parent=-1;?? 
????????li[i].left=left1(i);
????????li[i].right=right1(i);
????}
??????
??????
????for(i=1;i<=si;i++){
????????printf("node %d: ",i);
????????printf("key = %d, ",li[i].key);?? 
????????if(i!=1)
????????????printf("parent key = %d, ",li[i].parent);
????????if(si>=2*i)
????????????printf("left key = %d, ",li[i].left);
????????if(si>=2*i+1)
????????????printf("right key = %d, ",li[i].right);
????????printf("\n");?? 
????}
????return 0;
}