class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.p: G = None
        self.r: H = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.p: G = None
        self.r: H = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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