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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.t: E = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: A = None
        self.r: A = None
        self.q: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.t: E = None
        self.z: B = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: A = None
        self.r: A = None
        self.q: A = None
        self.txt = txt

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

m.y = e
m.s = e
m.t = a
b.z = m
a.v = b
a.z = b
a.o = i
a.t = n
a.r = d
d.u = g
d.s = b
d.v = b
d.y = n
n.w = g
n.o = g
n.r = g
n.q = g
e.u = g
e.s = b
e.v = b
e.y = n
g.y = d
g.t = a
g.s = e
i.v = b
i.z = b
i.o = a
i.t = n
i.r = d
assert n.w.y.u.y.u.s.y.txt == "n"