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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.w: B = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.w: B = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

m.z = h
m.r = c
m.x = n
j.o = n
e.u = j
e.y = n
e.o = n
e.v = n
b.q = n
b.u = m
n.v = b
n.r = c
n.p = c
n.w = j
n.x = j
i.u = j
i.y = n
i.o = n
i.v = n
k.z = m
k.r = e
k.x = n
c.u = j
c.y = n
c.o = n
c.v = n
h.z = k
h.r = c
h.x = n
assert c.v.v.u.z.z.z.z.txt == "h"