class A:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: E = None
        self.q: D = None
        self.z: C = None
        self.s: B = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: I = None
        self.x: C = None
        self.u: H = None
        self.p: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: B = None
        self.y: G = None
        self.v: G = None
        self.o: B = None
        self.r: E = None
        self.t: E = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: H = None
        self.w: J = None
        self.x: A = None
        self.s: C = None
        self.z: J = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: B = None
        self.r: I = None
        self.u: I = None
        self.o: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: C = None
        self.r: C = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: I = None
        self.x: C = None
        self.u: H = None
        self.p: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: B = None
        self.y: G = None
        self.v: G = None
        self.o: B = None
        self.r: E = None
        self.t: E = None
        self.x: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: H = None
        self.w: J = None
        self.x: A = None
        self.s: C = None
        self.z: J = None
        self.q: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: B = None
        self.r: I = None
        self.u: I = None
        self.o: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: C = None
        self.r: C = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.txt = txt

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

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