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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.z: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: D = None
        self.z: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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