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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: A = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: B = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.s: G = None
        self.p: E = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: A = None
        self.t: H = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: B = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: A = None
        self.s: G = None
        self.p: E = None
        self.z: B = None
        self.q: D = None
        self.txt = txt

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

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

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