class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.p: J = None
        self.z: C = None
        self.y: H = None
        self.r: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: H = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: F = None
        self.p: J = None
        self.z: C = None
        self.y: H = None
        self.r: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: H = None
        self.q: F = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: A = None
        self.txt = txt

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

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