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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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