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

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

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

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

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

c = A("c")
d = B("d")
f = C("f")
n = D("n")
e = E("e")
b = C("b")
i = D("i")
j = B("j")
h = A("h")

c.w = b
d.w = j
d.v = h
d.r = n
d.s = f
f.s = n
n.u = i
n.r = i
n.x = b
n.q = b
n.w = e
e.p = f
e.y = n
b.s = n
i.u = n
i.r = n
i.x = f
i.q = b
i.w = e
j.w = d
j.v = h
j.r = n
j.s = f
h.w = b
assert n.w.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

c = A("c")
d = B("d")
f = C("f")
n = D("n")
e = E("e")
b = C("b")
i = D("i")
j = B("j")
h = A("h")

c.w = b
d.w = j
d.v = h
d.r = n
d.s = f
f.s = n
n.u = i
n.r = i
n.x = b
n.q = b
n.w = e
e.p = f
e.y = n
b.s = n
i.u = n
i.r = n
i.x = f
i.q = b
i.w = e
j.w = d
j.v = h
j.r = n
j.s = f
h.w = b
assert n.w.p.s.txt == "n"