class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: H = None
        self.q: E = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.x: C = None
        self.q: H = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.o: D = None
        self.t: D = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: C = None
        self.r: C = None
        self.u: G = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.w: B = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: I = None
        self.u: G = None
        self.v: G = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: F = None
        self.x: C = None
        self.q: H = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: C = None
        self.o: D = None
        self.t: D = None
        self.y: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: C = None
        self.r: C = None
        self.u: G = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: B = None
        self.w: B = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: I = None
        self.u: G = None
        self.v: G = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: F = None
        self.o: F = None
        self.v: C = None
        self.txt = txt

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

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