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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

a = A("a")
b = B("b")
j = C("j")
i = D("i")
l = B("l")
e = C("e")
d = D("d")

a.w = i
a.o = i
a.z = b
a.s = e
b.t = a
j.w = d
j.p = e
j.q = e
j.y = a
i.s = b
i.p = a
i.z = d
i.u = d
l.t = a
e.w = d
e.p = j
e.q = j
e.y = a
d.s = b
d.p = a
d.z = i
d.u = i
assert e.y.z.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.s: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: A = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

a = A("a")
b = B("b")
j = C("j")
i = D("i")
l = B("l")
e = C("e")
d = D("d")

a.w = i
a.o = i
a.z = b
a.s = e
b.t = a
j.w = d
j.p = e
j.q = e
j.y = a
i.s = b
i.p = a
i.z = d
i.u = d
l.t = a
e.w = d
e.p = j
e.q = j
e.y = a
d.s = b
d.p = a
d.z = i
d.u = i
assert e.y.z.t.s.txt == "e"