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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: F = None
        self.q: E = None
        self.z: A = None
        self.u: B = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: J = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: E = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: F = None
        self.q: E = None
        self.z: A = None
        self.u: B = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: J = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: E = None
        self.v: C = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.t: E = None
        self.z: D = None
        self.txt = txt

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

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