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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: A = None
        self.p: C = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: A = None
        self.p: C = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

c.y = l
c.z = n
k.o = c
k.t = c
k.z = c
k.v = c
k.p = d
d.s = n
l.w = j
l.z = j
n.w = i
n.u = k
i.w = n
i.u = k
j.w = l
j.z = l
assert d.s.w.w.u.p.s.txt == "n"