Buggy python submission (verdict: Runtime Error):
#coding-utf8
#Complete Binary Tree

list=[]
list.append("sentinel")

def parent(i):
    return i//2

def left(i):
    return i*2

def right(i):
    return i*2+1

def main():
    H=int(input())
    for i in range(H):
        i+=1
        list.append(int(input()))
    for i in range(H):
        i+=1
        print("node "+str(i)+": key = "+str(list[i])+", ",end="")
        if(parent(i)):
            print("parent key = "+str(list[parent(i)])+", ",end="")
        if(left(i)<=H):
            print("left key = "+str(list[left(i)])+", ",end="")
        if(right(i)<=H):
            print("right key = "+str(list[right(i)])+", ",end="")
        print()

    return 0

if __name__ == "__main__":
    main()



Fixed submission:
#coding-utf8
#Complete Binary Tree

def parent(i):
    return i//2

def left(i):
    return i*2

def right(i):
    return i*2+1

def main():
    H=int(input())
    a = [0] + list(map(int, input().split()))

    for i in range(H):
        i+=1
        print("node "+str(i)+": key = "+str(a[i])+", ",end="")
        if(parent(i)):
            print("parent key = "+str(a[parent(i)])+", ",end="")
        if(left(i)<=H):
            print("left key = "+str(a[left(i)])+", ",end="")
        if(right(i)<=H):
            print("right key = "+str(a[right(i)])+", ",end="")
        print()

    return 0

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
#coding-utf8
#Complete Binary Tree

list=[]
list.append("sentinel")

def parent(i):
    return i//2

def left(i):
    return i*2

def right(i):
    return i*2+1

def main():
    H=int(input())
    for i in range(H):
        i+=1
        list.append(int(input()))
    for i in range(H):
        i+=1
        print("node "+str(i)+": key = "+str(list[i])+", ",end="")
        if(parent(i)):
            print("parent key = "+str(list[parent(i)])+", ",end="")
        if(left(i)<=H):
            print("left key = "+str(list[left(i)])+", ",end="")
        if(right(i)<=H):
            print("right key = "+str(list[right(i)])+", ",end="")
        print()

    return 0

if __name__ == "__main__":
    main()



Fixed submission:
#coding-utf8
#Complete Binary Tree

def parent(i):
    return i//2

def left(i):
    return i*2

def right(i):
    return i*2+1

def main():
    H=int(input())
    a = [0] + list(map(int, input().split()))

    for i in range(H):
        i+=1
        print("node "+str(i)+": key = "+str(a[i])+", ",end="")
        if(parent(i)):
            print("parent key = "+str(a[parent(i)])+", ",end="")
        if(left(i)<=H):
            print("left key = "+str(a[left(i)])+", ",end="")
        if(right(i)<=H):
            print("right key = "+str(a[right(i)])+", ",end="")
        print()

    return 0

if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
#coding-utf8
#Complete Binary Tree

list=[]
list.append("sentinel")

def parent(i):
    return i//2

def left(i):
    return i*2

def right(i):
    return i*2+1

def main():
    H=int(input())
    for i in range(H):
        i+=1
        list.append(int(input()))
    for i in range(H):
        i+=1
        print("node "+str(i)+": key = "+str(list[i])+", ",end="")
        if(parent(i)):
            print("parent key = "+str(list[parent(i)])+", ",end="")
        if(left(i)<=H):
            print("left key = "+str(list[left(i)])+", ",end="")
        if(right(i)<=H):
            print("right key = "+str(list[right(i)])+", ",end="")
        print()

    return 0

if __name__ == "__main__":
    main()



Fixed submission:
#coding-utf8
#Complete Binary Tree

def parent(i):
    return i//2

def left(i):
    return i*2

def right(i):
    return i*2+1

def main():
    H=int(input())
    a = [0] + list(map(int, input().split()))

    for i in range(H):
        i+=1
        print("node "+str(i)+": key = "+str(a[i])+", ",end="")
        if(parent(i)):
            print("parent key = "+str(a[parent(i)])+", ",end="")
        if(left(i)<=H):
            print("left key = "+str(a[left(i)])+", ",end="")
        if(right(i)<=H):
            print("right key = "+str(a[right(i)])+", ",end="")
        print()

    return 0

if __name__ == "__main__":
    main()