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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: I = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.o: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.x: C = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: I = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: G = None
        self.o: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: E = None
        self.x: C = None
        self.q: F = None
        self.txt = txt

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

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

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