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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: F = None
        self.p: H = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: F = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: I = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.o: B = None
        self.u: J = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.o: F = None
        self.z: C = None
        self.s: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.v: E = None
        self.r: B = None
        self.u: C = None
        self.p: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: F = None
        self.p: H = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: F = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: I = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: C = None
        self.o: B = None
        self.u: J = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.o: F = None
        self.z: C = None
        self.s: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.v: E = None
        self.r: B = None
        self.u: C = None
        self.p: F = None
        self.txt = txt

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

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