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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: H = None
        self.z: F = None
        self.o: I = None
        self.x: I = None
        self.s: H = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: I = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: G = None
        self.x: B = None
        self.r: G = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.z: H = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: A = None
        self.q: G = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: H = None
        self.z: F = None
        self.o: I = None
        self.x: I = None
        self.s: H = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: I = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: G = None
        self.x: B = None
        self.r: G = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.z: H = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: A = None
        self.q: G = None
        self.u: B = None
        self.txt = txt

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

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

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