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

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

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

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

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

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

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

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

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

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

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

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

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