class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: H = None
        self.t: E = None
        self.r: F = None
        self.x: J = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: F = None
        self.o: C = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.q: E = None
        self.z: B = None
        self.v: I = None
        self.y: D = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.y: I = None
        self.s: F = None
        self.t: E = None
        self.q: B = None
        self.u: B = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: F = None
        self.o: C = None
        self.r: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.q: E = None
        self.z: B = None
        self.v: I = None
        self.y: D = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: B = None
        self.y: I = None
        self.s: F = None
        self.t: E = None
        self.q: B = None
        self.u: B = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

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

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

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