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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: G = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: F = None
        self.r: G = None
        self.p: H = None
        self.o: J = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: G = None
        self.s: A = None
        self.q: J = None
        self.p: A = None
        self.z: A = None
        self.t: C = None
        self.x: J = None
        self.u: H = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: I = None
        self.q: D = None
        self.y: C = None
        self.x: D = None
        self.p: I = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.o: G = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: F = None
        self.r: G = None
        self.p: H = None
        self.o: J = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: G = None
        self.s: A = None
        self.q: J = None
        self.p: A = None
        self.z: A = None
        self.t: C = None
        self.x: J = None
        self.u: H = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: I = None
        self.q: D = None
        self.y: C = None
        self.x: D = None
        self.p: I = None
        self.u: D = None
        self.txt = txt

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

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

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

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