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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: F = None
        self.s: A = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: F = None
        self.s: A = None
        self.y: E = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: E = None
        self.txt = txt

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

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

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