class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: E = None
        self.o: C = None
        self.u: C = None
        self.x: F = None
        self.r: D = None
        self.q: D = None
        self.w: I = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: I = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: A = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: F = None
        self.p: B = None
        self.t: F = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: I = None
        self.v: E = None
        self.z: G = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: H = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
d = C("d")
f = D("f")
k = E("k")
c = F("c")
g = G("g")
h = H("h")
n = I("n")

m.v = g
m.z = k
m.o = d
m.u = d
m.x = c
m.r = f
m.q = f
m.w = n
m.t = a
a.t = m
a.s = n
a.v = c
a.q = f
d.w = h
f.o = g
f.z = m
f.r = h
k.o = g
k.z = c
k.t = c
k.p = a
k.s = d
k.u = f
c.p = f
c.q = n
c.v = k
c.z = g
c.w = m
g.r = f
g.p = h
h.x = f
h.t = f
h.v = f
h.o = g
h.y = d
h.z = a
h.p = m
n.s = f
n.t = f
n.w = d
n.x = m
assert c.v.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: E = None
        self.o: C = None
        self.u: C = None
        self.x: F = None
        self.r: D = None
        self.q: D = None
        self.w: I = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: I = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: A = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: F = None
        self.p: B = None
        self.t: F = None
        self.s: C = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: I = None
        self.v: E = None
        self.z: G = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: H = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
d = C("d")
f = D("f")
k = E("k")
c = F("c")
g = G("g")
h = H("h")
n = I("n")

m.v = g
m.z = k
m.o = d
m.u = d
m.x = c
m.r = f
m.q = f
m.w = n
m.t = a
a.t = m
a.s = n
a.v = c
a.q = f
d.w = h
f.o = g
f.z = m
f.r = h
k.o = g
k.z = c
k.t = c
k.p = a
k.s = d
k.u = f
c.p = f
c.q = n
c.v = k
c.z = g
c.w = m
g.r = f
g.p = h
h.x = f
h.t = f
h.v = f
h.o = g
h.y = d
h.z = a
h.p = m
n.s = f
n.t = f
n.w = d
n.x = m
assert c.v.s.w.txt == "h"