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

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

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

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

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

m = A("m")
i = B("i")
h = C("h")
c = D("c")
j = E("j")
a = E("a")
f = A("f")
k = B("k")

m.u = j
i.q = c
i.z = c
h.v = a
h.r = k
h.s = k
c.u = h
c.t = h
j.z = m
j.o = k
j.s = i
a.z = f
a.o = k
a.s = k
f.u = j
k.q = c
k.z = c
assert m.u.z.u.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
h = C("h")
c = D("c")
j = E("j")
a = E("a")
f = A("f")
k = B("k")

m.u = j
i.q = c
i.z = c
h.v = a
h.r = k
h.s = k
c.u = h
c.t = h
j.z = m
j.o = k
j.s = i
a.z = f
a.o = k
a.s = k
f.u = j
k.q = c
k.z = c
assert m.u.z.u.o.z.txt == "c"