console.log(require('fs').readFileSync('/dev/stdin','utf8').trim().split(/[ |\n]/).slice(1).map((k,i,a)=>`node ${++i}: key = ${k}, `+((i-1)?`parent key = ${a[Math.floor(i/2)-1]}, `:'')+(2*i=<a.length?`left key = ${a[2*i-1]}, `:'')+(2*i<a.length?`right key = ${a[2*i]}, `:'')).join('\n'));
