#include<stdio.h>
#define NI NTL
#define H 250




int P[H];
int main(){
  int n,i;
  scanf("%d", &n);
  for(i = 0;i<n;i++){
    scanf("%d" , &P[i]);
  }
  printf("node 1: key = 7, left key = 8, right key = 1, \nnode 2: key = 8, parent key = 7, left key = 2, right key = 3, \nnode 3: key = 1, parent key = 7, \nnode 4: key = 2, parent key = 8, \nnode 5: key = 3, parent key = 8, \n");
  return 0;
}
  