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

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

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

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

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

e = A("e")
k = B("k")
h = C("h")
b = D("b")
i = E("i")
l = E("l")
d = D("d")
j = D("j")
f = D("f")

e.u = h
k.r = f
k.o = e
h.t = l
h.q = e
h.x = d
h.z = i
b.z = l
i.s = k
l.s = k
d.z = i
j.z = l
f.z = l
assert j.z.s.r.z.s.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

e = A("e")
k = B("k")
h = C("h")
b = D("b")
i = E("i")
l = E("l")
d = D("d")
j = D("j")
f = D("f")

e.u = h
k.r = f
k.o = e
h.t = l
h.q = e
h.x = d
h.z = i
b.z = l
i.s = k
l.s = k
d.z = i
j.z = l
f.z = l
assert j.z.s.r.z.s.o.u.txt == "h"