class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: C = None
        self.o: F = None
        self.y: F = None
        self.z: B = None
        self.s: B = None
        self.p: G = 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.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: A = None
        self.z: E = None
        self.s: E = None
        self.w: A = None
        self.t: D = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.txt = txt

n = A("n")
c = B("c")
e = C("e")
m = D("m")
a = E("a")
i = F("i")
b = G("b")
d = H("d")

n.u = e
n.v = e
n.o = i
n.y = i
n.z = c
n.s = c
n.p = b
c.r = m
e.z = n
m.z = n
a.s = n
i.r = d
i.q = n
i.w = n
i.o = n
i.z = a
i.s = a
i.t = m
i.y = m
b.v = c
d.v = b
d.z = m
assert m.z.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: C = None
        self.o: F = None
        self.y: F = None
        self.z: B = None
        self.s: B = None
        self.p: G = 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.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: A = None
        self.z: E = None
        self.s: E = None
        self.w: A = None
        self.t: D = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.txt = txt

n = A("n")
c = B("c")
e = C("e")
m = D("m")
a = E("a")
i = F("i")
b = G("b")
d = H("d")

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