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

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

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

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

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

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

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

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

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

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

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

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

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