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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.z: G = None
        self.t: B = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: D = None
        self.y: A = None
        self.w: E = None
        self.u: I = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.z: F = None
        self.o: A = None
        self.w: F = None
        self.p: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: A = None
        self.z: G = None
        self.t: B = None
        self.o: E = None
        self.q: I = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.t: D = None
        self.y: A = None
        self.w: E = None
        self.u: I = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.z: F = None
        self.o: A = None
        self.w: F = None
        self.p: F = None
        self.txt = txt

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

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