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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: I = None
        self.o: E = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: I = None
        self.o: E = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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