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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: I = None
        self.y: A = None
        self.w: I = None
        self.x: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.o: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: D = None
        self.r: D = None
        self.p: E = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: I = None
        self.y: A = None
        self.w: I = None
        self.x: D = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: A = None
        self.o: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: D = None
        self.r: D = None
        self.p: E = None
        self.o: H = None
        self.txt = txt

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

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

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

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

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