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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.txt = txt

c = A("c")
i = B("i")
m = C("m")
d = D("d")
g = E("g")
e = C("e")

c.u = e
c.s = g
c.z = g
c.x = i
i.v = e
m.s = i
d.o = e
d.x = c
d.u = c
g.t = d
g.r = i
e.s = i
assert g.t.u.x.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: E = None
        self.z: E = None
        self.x: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: B = None
        self.txt = txt

c = A("c")
i = B("i")
m = C("m")
d = D("d")
g = E("g")
e = C("e")

c.u = e
c.s = g
c.z = g
c.x = i
i.v = e
m.s = i
d.o = e
d.x = c
d.u = c
g.t = d
g.r = i
e.s = i
assert g.t.u.x.v.s.txt == "i"