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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: G = None
        self.w: F = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: I = None
        self.p: H = None
        self.z: F = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.t: H = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: G = None
        self.w: F = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: I = None
        self.p: H = None
        self.z: F = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.t: H = None
        self.v: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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