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

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

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

c = A("c")
l = B("l")
e = C("e")

c.u = l
c.z = e
l.q = c
l.t = c
e.x = l
assert l.q.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: C = None
        self.txt = txt

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

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

c = A("c")
l = B("l")
e = C("e")

c.u = l
c.z = e
l.q = c
l.t = c
e.x = l
assert l.q.z.x.txt == "l"