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

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

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

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

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

m = A("m")
a = B("a")
i = C("i")
l = D("l")
n = E("n")
f = E("f")
j = D("j")
g = E("g")

m.v = a
m.x = a
a.u = f
a.w = f
a.q = n
a.r = l
i.s = n
i.q = j
i.x = g
l.o = m
l.r = i
l.t = i
l.w = n
n.w = a
n.s = a
n.z = g
f.w = a
f.s = a
f.z = n
j.o = m
j.r = i
j.t = i
j.w = n
g.w = a
g.s = a
g.z = n
assert f.s.u.z.z.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: B = None
        self.txt = txt

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

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

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

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

m = A("m")
a = B("a")
i = C("i")
l = D("l")
n = E("n")
f = E("f")
j = D("j")
g = E("g")

m.v = a
m.x = a
a.u = f
a.w = f
a.q = n
a.r = l
i.s = n
i.q = j
i.x = g
l.o = m
l.r = i
l.t = i
l.w = n
n.w = a
n.s = a
n.z = g
f.w = a
f.s = a
f.z = n
j.o = m
j.r = i
j.t = i
j.w = n
g.w = a
g.s = a
g.z = n
assert f.s.u.z.z.z.s.txt == "a"