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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.y: A = None
        self.txt = txt

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

n.s = i
n.o = c
j.x = b
j.u = b
i.u = n
b.z = i
b.o = i
b.x = j
b.w = j
c.v = b
c.s = b
c.y = n
assert i.u.s.u.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: D = None
        self.y: A = None
        self.txt = txt

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

n.s = i
n.o = c
j.x = b
j.u = b
i.u = n
b.z = i
b.o = i
b.x = j
b.w = j
c.v = b
c.s = b
c.y = n
assert i.u.s.u.o.y.txt == "n"