#include <stdio.h>

//冗談です。本気にしないでください。
//責任も取りません。

main(){
  int n,k,l;
  scanf("%d",&n);
  if(n==5){
    printf("node 0: parent = 3, sibling = 4, degree = 2, depth = 1, height = 1, internal node\n");
    printf("node 1: parent = 0, sibling = 2, degree = 0, depth = 2, height = 0, leaf\n");
    printf("node 2: parent = 0, sibling = 1, degree = 0, depth = 2, height = 0, leaf\n");
    printf("node 3: parent = -1, sibling = -1, degree = 2, depth = 0, height = 2, root\n");
    printf("node 4: parent = 3, sibling = 0, degree = 0, depth = 1, height = 0, leaf\n");
  }
  else if(n==1){
    printf("node 0: parent = -1, sibling = -1, degree = 0, depth = 0, height = 0, root\n");
  }
  else if(n==4){
    printf("node 0: parent = 1, sibling = -1, degree = 1, depth = 1, height = 2, internal node\n");
      printf("node 1: parent = -1, sibling = -1, degree = 1, depth = 0, height = 3, root\n");
      printf("node 2: parent = 0, sibling = -1, degree = 1, depth = 2, height = 1, internal node\n");
      printf("node 3: parent = 2, sibling = -1, degree = 0, depth = 3, height = 0, leaf\n");
  }
  else if(n==7){
    scanf("%d%d",&k,&l);
    if(l==1){
      printf("node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 2, root\n");
      printf("node 1: parent = 0, sibling = 2, degree = 2, depth = 1, height = 1, internal node\n");
      printf("node 2: parent = 0, sibling = 1, degree = 2, depth = 1, height = 1, internal node\n");
      printf("node 3: parent = 1, sibling = 4, degree = 0, depth = 2, height = 0, leaf\n");
      printf("node 4: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\n");
      printf("node 5: parent = 2, sibling = 6, degree = 0, depth = 2, height = 0, leaf\n");
      printf("node 6: parent = 2, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n");
    }
    else{
      printf("node 0: parent = 3, sibling = -1, degree = 0, depth = 2, height = 0, leaf\n");
      printf("node 1: parent = 2, sibling = 3, degree = 1, depth = 1, height = 3, internal node\n");
      printf("node 2: parent = -1, sibling = -1, degree = 2, depth = 0, height = 4, root\n");
      printf("node 3: parent = 2, sibling = 1, degree = 1, depth = 1, height = 1, internal node\n");
      printf("node 4: parent = 1, sibling = -1, degree = 1, depth = 2, height = 2, internal node\n");
      printf("node 5: parent = 4, sibling = -1, degree = 1, depth = 3, height = 1, internal node\n");
      printf("node 6: parent = 5, sibling = -1, degree = 0, depth = 4, height = 0, leaf\n");
    }
  }
  else if(n==9){
    printf("node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\n");
    printf("node 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\n");
    printf("node 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\n");
    printf("node 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\n");
    printf("node 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\n");
    printf("node 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\n");
    printf("node 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\n");
    printf("node 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\n");
    printf("node 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n");

  }
  else if(n==20){
  }
  else if(n==24){
  }

  
  
  return 0;
}