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

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

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

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

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

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

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

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

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

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

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

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

d.w = n
d.s = j
d.t = b
d.u = b
d.z = b
b.x = c
b.v = j
c.y = d
c.q = j
c.o = j
n.o = b
n.p = c
j.r = b
j.y = b
j.z = c
assert d.t.v.z.y.txt == "d"