class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.s: I = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: J = None
        self.p: A = None
        self.r: G = None
        self.y: H = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: F = None
        self.y: A = None
        self.s: B = None
        self.z: F = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: J = None
        self.w: A = None
        self.v: A = None
        self.o: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: D = None
        self.s: I = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: J = None
        self.p: A = None
        self.r: G = None
        self.y: H = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: F = None
        self.y: A = None
        self.s: B = None
        self.z: F = None
        self.t: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: J = None
        self.w: A = None
        self.v: A = None
        self.o: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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