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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: A = None
        self.p: E = None
        self.q: A = None
        self.s: A = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: H = None
        self.s: E = None
        self.p: E = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: A = None
        self.p: E = None
        self.q: A = None
        self.s: A = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: H = None
        self.s: E = None
        self.p: E = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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