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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: I = None
        self.s: C = None
        self.w: I = None
        self.z: H = None
        self.v: F = None
        self.t: H = None
        self.y: H = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: H = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: I = None
        self.z: H = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.p: D = None
        self.z: I = None
        self.v: D = None
        self.q: I = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.v: D = None
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: I = None
        self.s: C = None
        self.w: I = None
        self.z: H = None
        self.v: F = None
        self.t: H = None
        self.y: H = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: H = None
        self.t: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: I = None
        self.z: H = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: A = None
        self.p: D = None
        self.z: I = None
        self.v: D = None
        self.q: I = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.v: D = None
        self.t: G = None
        self.txt = txt

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

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