class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

e = A("e")
d = B("d")
h = C("h")
a = D("a")
m = B("m")
l = D("l")
b = C("b")
g = B("g")
i = A("i")

e.y = a
d.v = e
d.o = e
h.s = b
h.o = b
h.t = e
h.q = l
a.r = l
a.z = l
a.u = h
m.v = e
m.o = i
l.r = a
l.z = a
l.u = b
b.s = h
b.o = h
b.t = i
b.q = l
g.v = e
g.o = i
i.y = l
assert a.u.s.o.q.u.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

e = A("e")
d = B("d")
h = C("h")
a = D("a")
m = B("m")
l = D("l")
b = C("b")
g = B("g")
i = A("i")

e.y = a
d.v = e
d.o = e
h.s = b
h.o = b
h.t = e
h.q = l
a.r = l
a.z = l
a.u = h
m.v = e
m.o = i
l.r = a
l.z = a
l.u = b
b.s = h
b.o = h
b.t = i
b.q = l
g.v = e
g.o = i
i.y = l
assert a.u.s.o.q.u.t.y.txt == "l"