class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

b = A("b")
c = B("c")
i = A("i")
h = B("h")

b.t = c
b.z = c
c.u = h
i.t = c
i.z = c
h.u = c
assert c.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

b = A("b")
c = B("c")
i = A("i")
h = B("h")

b.t = c
b.z = c
c.u = h
i.t = c
i.z = c
h.u = c
assert c.u.u.u.txt == "h"