class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: C = None
        self.u: B = None
        self.o: F = None
        self.w: J = None
        self.s: H = None
        self.q: G = None
        self.t: G = None
        self.r: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.y: G = None
        self.t: G = None
        self.p: C = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: I = None
        self.p: I = None
        self.z: B = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: F = None
        self.p: F = None
        self.y: D = None
        self.s: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: G = None
        self.t: J = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.p: I = None
        self.q: F = None
        self.txt = txt

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

g.x = a
g.w = a
g.p = k
g.u = e
g.o = d
g.z = d
g.s = b
g.q = j
g.t = j
g.r = j
e.v = g
e.s = g
e.y = j
e.t = j
e.p = k
e.o = d
k.x = d
k.s = i
n.q = g
n.p = g
n.w = g
n.z = b
n.x = b
n.t = a
n.u = j
n.y = l
n.s = i
n.v = k
l.o = a
l.q = i
l.p = i
l.y = i
l.z = e
d.t = a
j.w = d
j.r = d
j.p = d
j.y = n
j.s = a
b.t = a
i.o = d
i.w = d
i.q = j
i.y = j
i.t = a
a.o = l
a.v = e
a.p = i
a.q = d
assert d.t.q.t.p.t.q.t.q.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: C = None
        self.u: B = None
        self.o: F = None
        self.w: J = None
        self.s: H = None
        self.q: G = None
        self.t: G = None
        self.r: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.y: G = None
        self.t: G = None
        self.p: C = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: I = None
        self.p: I = None
        self.z: B = None
        self.y: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: F = None
        self.p: F = None
        self.y: D = None
        self.s: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: G = None
        self.t: J = None
        self.y: G = None
        self.w: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: B = None
        self.p: I = None
        self.q: F = None
        self.txt = txt

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

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