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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: G = None
        self.q: C = None
        self.y: D = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.o: A = None
        self.s: B = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: C = None
        self.p: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: G = None
        self.q: C = None
        self.y: D = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: C = None
        self.o: A = None
        self.s: B = None
        self.x: D = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.q: C = None
        self.p: C = None
        self.y: B = None
        self.txt = txt

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

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