class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.o: D = None
        self.p: C = None
        self.z: A = None
        self.v: D = None
        self.txt = txt

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

m = A("m")
a = B("a")
i = C("i")
n = D("n")
h = E("h")
b = F("b")

m.w = h
m.x = b
m.v = n
a.w = b
i.r = n
i.p = n
i.u = n
i.z = m
i.t = m
i.q = a
n.y = b
n.p = b
n.o = m
h.u = i
h.p = i
h.s = m
h.z = m
h.o = n
h.v = n
b.x = h
b.o = i
b.v = n
assert m.w.z.x.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: A = None
        self.o: D = None
        self.p: C = None
        self.z: A = None
        self.v: D = None
        self.txt = txt

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

m = A("m")
a = B("a")
i = C("i")
n = D("n")
h = E("h")
b = F("b")

m.w = h
m.x = b
m.v = n
a.w = b
i.r = n
i.p = n
i.u = n
i.z = m
i.t = m
i.q = a
n.y = b
n.p = b
n.o = m
h.u = i
h.p = i
h.s = m
h.z = m
h.o = n
h.v = n
b.x = h
b.o = i
b.v = n
assert m.w.z.x.o.u.txt == "n"