#include <stdio.h>
#define N 100000

Node node[N];

int main(){
  int n;
  int i;

  struct Node{
    int p,l,r;
  };

  scanf("%d",&n);
  for(i=0; i<n; i++){
    scanf("%d",&node[i]);
    scanf("%d",);

  }
  for(i=0; i<n; i++){
    printf("node %d: ",node[i]);
    printf("parent = %d, ",);
    printf("depth = %d, ");
    if(parent==-1)
      printf("root, ");
    else if(){
      printf("internal node, ");
    else{
      printf("leaf");
    }
    }
  }

}

