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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.r: B = None
        self.s: I = None
        self.w: E = None
        self.x: B = None
        self.y: G = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: B = None
        self.v: H = None
        self.p: B = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.x: I = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: D = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: C = None
        self.r: B = None
        self.s: I = None
        self.w: E = None
        self.x: B = None
        self.y: G = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: B = None
        self.v: H = None
        self.p: B = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: D = None
        self.x: I = None
        self.q: B = None
        self.txt = txt

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

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

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