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

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

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

f = A("f")
l = B("l")
j = C("j")
a = C("a")
e = B("e")
d = C("d")

f.x = l
f.q = l
l.v = f
l.z = f
l.s = e
j.q = d
j.u = f
a.q = j
a.u = f
e.v = f
e.z = f
e.s = l
d.q = j
d.u = f
assert a.u.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: B = None
        self.txt = txt

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

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

f = A("f")
l = B("l")
j = C("j")
a = C("a")
e = B("e")
d = C("d")

f.x = l
f.q = l
l.v = f
l.z = f
l.s = e
j.q = d
j.u = f
a.q = j
a.u = f
e.v = f
e.z = f
e.s = l
d.q = j
d.u = f
assert a.u.x.z.txt == "f"