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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.r: C = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.r: B = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

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

a = A("a")
n = B("n")
j = C("j")
e = D("e")
c = E("c")
g = C("g")
m = D("m")

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: A = None
        self.r: C = None
        self.v: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.r: B = None
        self.z: B = None
        self.o: B = None
        self.txt = txt

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

a = A("a")
n = B("n")
j = C("j")
e = D("e")
c = E("c")
g = C("g")
m = D("m")

a.y = e
a.o = g
n.y = m
n.s = e
n.v = e
j.q = e
j.o = a
j.r = g
j.v = n
j.u = n
e.u = n
e.w = n
e.r = n
e.z = n
e.o = n
c.v = j
g.q = m
g.o = a
g.r = j
g.v = n
g.u = n
m.u = n
m.w = n
m.r = n
m.z = n
m.o = n
assert m.u.y.u.txt == "n"