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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.t: J = None
        self.x: E = None
        self.w: J = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: G = None
        self.t: J = None
        self.x: E = None
        self.w: J = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

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

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

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

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