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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.q: A = None
        self.txt = txt

m = A("m")
e = B("e")
n = C("n")
i = D("i")
h = E("h")
a = D("a")

m.w = n
m.p = e
m.v = e
m.t = h
e.v = a
e.y = a
e.x = h
e.u = m
e.s = n
n.r = m
n.s = m
n.o = i
i.s = n
i.w = n
i.o = a
i.v = e
h.r = n
h.z = a
h.q = m
a.s = n
a.w = n
a.o = i
a.v = e
assert m.t.z.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: B = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.q: A = None
        self.txt = txt

m = A("m")
e = B("e")
n = C("n")
i = D("i")
h = E("h")
a = D("a")

m.w = n
m.p = e
m.v = e
m.t = h
e.v = a
e.y = a
e.x = h
e.u = m
e.s = n
n.r = m
n.s = m
n.o = i
i.s = n
i.w = n
i.o = a
i.v = e
h.r = n
h.z = a
h.q = m
a.s = n
a.w = n
a.o = i
a.v = e
assert m.t.z.s.o.txt == "i"