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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: C = None
        self.w: G = None
        self.r: F = None
        self.txt = txt

a = A("a")
g = B("g")
e = C("e")
m = D("m")
n = E("n")
f = F("f")
l = G("l")
j = H("j")
k = I("k")

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

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

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: C = None
        self.w: G = None
        self.r: F = None
        self.txt = txt

a = A("a")
g = B("g")
e = C("e")
m = D("m")
n = E("n")
f = F("f")
l = G("l")
j = H("j")
k = I("k")

a.s = e
a.u = e
a.w = n
a.t = f
a.r = f
a.v = j
a.x = m
a.q = l
g.t = m
g.u = f
g.q = j
g.s = j
g.y = a
g.w = e
g.v = l
e.s = k
m.t = e
m.p = f
n.y = m
n.r = j
n.v = k
n.z = e
f.v = l
f.o = l
f.t = l
f.z = a
f.x = a
f.w = e
f.y = k
f.u = m
f.r = j
l.z = g
l.o = j
j.v = k
j.t = l
k.u = f
k.r = f
k.v = e
k.w = l
assert m.t.s.v.txt == "e"