class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.y: B = None
        self.p: B = None
        self.s: H = None
        self.r: C = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.s: A = None
        self.u: D = None
        self.q: E = None
        self.x: H = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

n = A("n")
i = B("i")
g = C("g")
m = D("m")
l = E("l")
f = F("f")
e = G("e")
d = H("d")

n.t = m
n.u = i
n.y = i
n.p = i
n.s = d
n.r = g
n.q = l
n.o = l
i.y = l
g.w = i
m.p = l
m.s = l
m.q = l
m.y = i
l.s = g
l.q = g
l.v = e
l.o = m
f.t = l
e.y = l
e.q = l
e.o = l
e.z = i
e.s = n
e.u = m
e.x = d
e.p = g
d.z = f
assert d.z.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: B = None
        self.y: B = None
        self.p: B = None
        self.s: H = None
        self.r: C = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.s: A = None
        self.u: D = None
        self.q: E = None
        self.x: H = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

n = A("n")
i = B("i")
g = C("g")
m = D("m")
l = E("l")
f = F("f")
e = G("e")
d = H("d")

n.t = m
n.u = i
n.y = i
n.p = i
n.s = d
n.r = g
n.q = l
n.o = l
i.y = l
g.w = i
m.p = l
m.s = l
m.q = l
m.y = i
l.s = g
l.q = g
l.v = e
l.o = m
f.t = l
e.y = l
e.q = l
e.o = l
e.z = i
e.s = n
e.u = m
e.x = d
e.p = g
d.z = f
assert d.z.t.o.txt == "m"