class Box:
    def __init__(self, length, width, height):
        self.length = length
        self.width = width
        self.height = height
        self.plist = list()
        self.plength = 0

    def __lt__(self, other):
        return (self.length < other.length
                and self.width < other.width
                and self.height < other.height)

    def __gt__(self, other):
        return (self.length > other.length
                and self.width > other.width
                and self.height > other.height)

    def link_to(self, box):
        self.plist.append(box)
        self.plength += 1
"""
    Test for input:
    def print_content(self):
        print(self.length, self.width, self.height)
"""


def main():
    N = int(input())
    box = list()
    for i in range(N):
        x = input()
        x = x.split(' ')
        x = Box(x[0], x[1], x[2])
        box.append(x)
#    Test:
#    for i, x in enumerate(box):
#        x.print_content()

if __name__ == "__main__":
    main()

@@ -188,16 +188,43 @@
 ngth = 0
+%0A        self.be_linked = 0
 %0A%0A    de
@@ -571,19 +571,21 @@
 o(self, 
-box
+other
 ):%0A     
@@ -605,19 +605,21 @@
 .append(
-box
+other
 )%0A      
@@ -638,16 +638,46 @@
 th += 1%0A
+        other.be_linked += 1%0A%0A
 %22%22%22%0A    

Add new attribute be_linked to class Box in order to record how many object point to self.