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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

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

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

m = A("m")
g = B("g")
j = C("j")
l = D("l")
a = E("a")
k = A("k")
n = A("n")
d = D("d")
b = C("b")

m.y = d
m.w = d
m.z = l
m.v = k
m.s = k
g.v = b
g.z = b
g.x = k
g.s = m
j.u = d
l.w = a
l.s = g
a.s = g
k.y = d
k.w = d
k.z = l
k.v = m
k.s = n
n.y = l
n.w = d
n.z = d
n.v = m
n.s = m
d.w = a
d.s = g
b.u = d
assert b.u.w.s.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: D = None
        self.z: D = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: A = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

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

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

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

m = A("m")
g = B("g")
j = C("j")
l = D("l")
a = E("a")
k = A("k")
n = A("n")
d = D("d")
b = C("b")

m.y = d
m.w = d
m.z = l
m.v = k
m.s = k
g.v = b
g.z = b
g.x = k
g.s = m
j.u = d
l.w = a
l.s = g
a.s = g
k.y = d
k.w = d
k.z = l
k.v = m
k.s = n
n.y = l
n.w = d
n.z = d
n.v = m
n.s = m
d.w = a
d.s = g
b.u = d
assert b.u.w.s.s.v.s.txt == "n"