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

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

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

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

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

f = A("f")
k = B("k")
m = C("m")
e = D("e")
h = E("h")
n = E("n")
c = D("c")
l = B("l")
a = C("a")

f.z = l
f.v = l
k.o = l
k.s = a
m.p = a
m.z = c
m.q = c
m.v = c
m.x = c
e.o = m
h.x = f
h.r = n
h.o = n
h.q = n
h.z = a
n.x = f
n.r = h
n.o = h
n.q = h
n.z = m
c.o = a
l.o = k
l.s = a
a.p = m
a.z = e
a.x = e
a.q = c
a.v = c
assert k.s.z.o.z.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

f = A("f")
k = B("k")
m = C("m")
e = D("e")
h = E("h")
n = E("n")
c = D("c")
l = B("l")
a = C("a")

f.z = l
f.v = l
k.o = l
k.s = a
m.p = a
m.z = c
m.q = c
m.v = c
m.x = c
e.o = m
h.x = f
h.r = n
h.o = n
h.q = n
h.z = a
n.x = f
n.r = h
n.o = h
n.q = h
n.z = m
c.o = a
l.o = k
l.s = a
a.p = m
a.z = e
a.x = e
a.q = c
a.v = c
assert k.s.z.o.z.o.p.txt == "m"