class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: D = None
        self.u: G = None
        self.t: A = None
        self.w: C = None
        self.z: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: D = None
        self.u: G = None
        self.t: A = None
        self.w: C = None
        self.z: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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