class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: E = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: E = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: C = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.z: H = None
        self.t: D = None
        self.u: G = None
        self.x: E = None
        self.v: B = None
        self.p: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.x: E = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: C = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: E = None
        self.z: H = None
        self.t: D = None
        self.u: G = None
        self.x: E = None
        self.v: B = None
        self.p: J = None
        self.txt = txt

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

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

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