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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.r: A = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

e = A("e")
m = B("m")
g = C("g")
a = D("a")
k = E("k")
d = A("d")
j = C("j")

e.v = m
e.s = k
m.v = a
m.o = g
g.y = k
g.s = k
g.p = k
g.r = m
g.o = e
a.p = k
a.o = k
a.w = k
a.z = m
a.r = e
k.x = a
k.t = j
d.v = m
d.s = k
j.y = k
j.s = k
j.p = k
j.r = m
j.o = d
assert a.z.v.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: B = None
        self.r: A = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

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

e = A("e")
m = B("m")
g = C("g")
a = D("a")
k = E("k")
d = A("d")
j = C("j")

e.v = m
e.s = k
m.v = a
m.o = g
g.y = k
g.s = k
g.p = k
g.r = m
g.o = e
a.p = k
a.o = k
a.w = k
a.z = m
a.r = e
k.x = a
k.t = j
d.v = m
d.s = k
j.y = k
j.s = k
j.p = k
j.r = m
j.o = d
assert a.z.v.z.v.txt == "a"