class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
j = C("j")
h = D("h")
a = E("a")
l = E("l")

m.q = h
m.r = i
m.s = a
m.t = l
i.s = j
j.u = i
j.o = a
h.t = i
a.s = l
a.y = i
l.s = a
l.y = i
assert h.t.s.o.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: B = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

m = A("m")
i = B("i")
j = C("j")
h = D("h")
a = E("a")
l = E("l")

m.q = h
m.r = i
m.s = a
m.t = l
i.s = j
j.u = i
j.o = a
h.t = i
a.s = l
a.y = i
l.s = a
l.y = i
assert h.t.s.o.s.y.s.txt == "j"