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

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

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

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

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

d = A("d")
g = B("g")
j = C("j")
l = D("l")
a = E("a")
m = E("m")

d.q = j
d.t = a
d.z = a
d.w = l
d.o = m
g.z = a
j.y = d
l.v = a
l.u = a
a.s = d
m.s = d
assert d.t.s.q.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.w: D = None
        self.z: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

d = A("d")
g = B("g")
j = C("j")
l = D("l")
a = E("a")
m = E("m")

d.q = j
d.t = a
d.z = a
d.w = l
d.o = m
g.z = a
j.y = d
l.v = a
l.u = a
a.s = d
m.s = d
assert d.t.s.q.y.w.txt == "l"