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

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

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

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

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

h.u = l
h.s = b
h.v = m
d.q = c
k.u = e
k.o = l
m.z = b
i.u = l
i.v = l
i.s = b
b.u = m
b.o = l
l.z = b
n.q = c
e.z = b
c.u = e
c.o = m
assert m.z.u.z.o.z.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

h.u = l
h.s = b
h.v = m
d.q = c
k.u = e
k.o = l
m.z = b
i.u = l
i.v = l
i.s = b
b.u = m
b.o = l
l.z = b
n.q = c
e.z = b
c.u = e
c.o = m
assert m.z.u.z.o.z.u.z.txt == "b"