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

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

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

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

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

c = A("c")
k = B("k")
m = C("m")
n = D("n")
b = E("b")
f = D("f")
i = E("i")
h = A("h")
e = C("e")
g = D("g")

c.v = h
c.z = e
c.s = e
c.x = k
k.v = b
k.w = e
k.z = i
k.s = m
m.v = f
n.t = m
n.w = c
n.z = k
b.s = g
f.t = e
f.w = c
f.z = k
i.s = f
h.v = c
h.z = e
h.s = e
h.x = k
e.v = f
g.t = e
g.w = c
g.z = k
assert m.v.w.s.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: C = None
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

c = A("c")
k = B("k")
m = C("m")
n = D("n")
b = E("b")
f = D("f")
i = E("i")
h = A("h")
e = C("e")
g = D("g")

c.v = h
c.z = e
c.s = e
c.x = k
k.v = b
k.w = e
k.z = i
k.s = m
m.v = f
n.t = m
n.w = c
n.z = k
b.s = g
f.t = e
f.w = c
f.z = k
i.s = f
h.v = c
h.z = e
h.s = e
h.x = k
e.v = f
g.t = e
g.w = c
g.z = k
assert m.v.w.s.v.z.txt == "k"