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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: E = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

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

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

j = A("j")
c = B("c")
i = C("i")
b = D("b")
d = E("d")
l = D("l")

j.y = l
j.w = l
j.z = c
j.s = d
c.r = b
c.q = b
c.u = d
i.q = j
i.t = j
i.r = d
i.v = d
b.z = c
b.p = d
b.w = d
d.s = l
l.z = c
l.p = d
l.w = d
assert j.z.r.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.s: E = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: E = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

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

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

j = A("j")
c = B("c")
i = C("i")
b = D("b")
d = E("d")
l = D("l")

j.y = l
j.w = l
j.z = c
j.s = d
c.r = b
c.q = b
c.u = d
i.q = j
i.t = j
i.r = d
i.v = d
b.z = c
b.p = d
b.w = d
d.s = l
l.z = c
l.p = d
l.w = d
assert j.z.r.w.s.txt == "l"