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

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: E = None
        self.x: J = None
        self.q: F = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: G = None
        self.z: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: H = None
        self.t: J = None
        self.r: B = None
        self.s: D = None
        self.y: F = None
        self.q: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: E = None
        self.x: J = None
        self.q: F = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: G = None
        self.z: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: H = None
        self.t: J = None
        self.r: B = None
        self.s: D = None
        self.y: F = None
        self.q: J = None
        self.txt = txt

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

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

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