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

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

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

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

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

b = A("b")
d = B("d")
i = C("i")
m = D("m")
e = E("e")
g = C("g")
n = C("n")
j = A("j")

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

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

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

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

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

b = A("b")
d = B("d")
i = C("i")
m = D("m")
e = E("e")
g = C("g")
n = C("n")
j = A("j")

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