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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: G = None
        self.v: F = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: H = None
        self.o: H = None
        self.s: E = None
        self.t: J = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: G = None
        self.z: H = None
        self.v: D = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: A = None
        self.u: I = None
        self.r: C = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: G = None
        self.v: F = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: H = None
        self.o: H = None
        self.s: E = None
        self.t: J = None
        self.u: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: G = None
        self.z: H = None
        self.v: D = None
        self.t: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: A = None
        self.u: I = None
        self.r: C = None
        self.w: G = None
        self.txt = txt

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

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