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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.z: E = None
        self.t: F = None
        self.x: A = None
        self.s: I = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: H = None
        self.x: G = None
        self.t: C = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: J = None
        self.x: D = None
        self.w: J = None
        self.u: C = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.q: I = None
        self.y: F = None
        self.p: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.z: E = None
        self.t: F = None
        self.x: A = None
        self.s: I = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: J = None
        self.u: H = None
        self.x: G = None
        self.t: C = None
        self.p: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: J = None
        self.x: D = None
        self.w: J = None
        self.u: C = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: F = None
        self.q: I = None
        self.y: F = None
        self.p: I = None
        self.txt = txt

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

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