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

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

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

b = A("b")
l = B("l")
i = C("i")
j = B("j")

b.t = j
b.u = j
b.y = l
l.r = b
l.t = j
i.z = b
i.y = j
i.o = l
j.r = b
j.t = l
assert l.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: B = None
        self.y: B = None
        self.txt = txt

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

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

b = A("b")
l = B("l")
i = C("i")
j = B("j")

b.t = j
b.u = j
b.y = l
l.r = b
l.t = j
i.z = b
i.y = j
i.o = l
j.r = b
j.t = l
assert l.r.u.r.txt == "b"