class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: G = None
        self.v: E = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: C = None
        self.t: C = None
        self.p: F = None
        self.q: E = None
        self.r: B = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: C = None
        self.q: A = None
        self.y: D = None
        self.p: G = None
        self.r: A = None
        self.w: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: G = None
        self.v: E = None
        self.z: I = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: C = None
        self.t: C = None
        self.p: F = None
        self.q: E = None
        self.r: B = None
        self.u: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: C = None
        self.q: A = None
        self.y: D = None
        self.p: G = None
        self.r: A = None
        self.w: D = None
        self.txt = txt

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

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

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