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

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

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

j = A("j")
k = B("k")
c = C("c")
e = C("e")
b = B("b")

j.z = c
j.u = c
j.o = e
k.v = b
k.q = j
k.t = e
c.z = e
c.o = e
c.y = j
e.z = c
e.o = c
e.y = j
b.v = k
b.q = j
b.t = c
assert e.o.z.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

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

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

j = A("j")
k = B("k")
c = C("c")
e = C("e")
b = B("b")

j.z = c
j.u = c
j.o = e
k.v = b
k.q = j
k.t = e
c.z = e
c.o = e
c.y = j
e.z = c
e.o = c
e.y = j
b.v = k
b.q = j
b.t = c
assert e.o.z.y.o.txt == "e"