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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.w: E = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

j = A("j")
e = B("e")
i = C("i")
m = D("m")
c = E("c")
n = E("n")

j.s = i
e.o = c
e.q = j
e.w = n
i.u = m
i.w = e
m.o = n
m.u = e
m.z = e
m.w = c
m.t = i
c.o = i
n.o = i
assert j.s.u.o.o.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: B = None
        self.w: E = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

j = A("j")
e = B("e")
i = C("i")
m = D("m")
c = E("c")
n = E("n")

j.s = i
e.o = c
e.q = j
e.w = n
i.u = m
i.w = e
m.o = n
m.u = e
m.z = e
m.w = c
m.t = i
c.o = i
n.o = i
assert j.s.u.o.o.w.w.txt == "n"