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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.w: A = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.w: A = None
        self.x: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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