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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.r: B = None
        self.q: A = None
        self.txt = txt

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

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

e.w = b
e.o = h
e.v = h
e.z = f
b.w = n
f.t = n
h.w = e
h.q = e
h.x = c
h.r = b
n.v = e
n.p = e
n.r = h
n.s = f
c.w = e
c.q = e
c.x = h
c.r = b
assert b.w.r.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: D = None
        self.z: C = None
        self.v: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: D = None
        self.r: B = None
        self.q: A = None
        self.txt = txt

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

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

e.w = b
e.o = h
e.v = h
e.z = f
b.w = n
f.t = n
h.w = e
h.q = e
h.x = c
h.r = b
n.v = e
n.p = e
n.r = h
n.s = f
c.w = e
c.q = e
c.x = h
c.r = b
assert b.w.r.w.w.w.txt == "n"