class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.o: F = None
        self.z: H = None
        self.r: B = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: H = None
        self.v: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: H = None
        self.v: I = None
        self.txt = txt

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

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

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

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