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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: J = None
        self.q: J = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: H = None
        self.r: H = None
        self.y: E = None
        self.x: E = None
        self.s: E = None
        self.t: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.p: J = None
        self.s: J = None
        self.w: C = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: J = None
        self.q: J = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: H = None
        self.r: H = None
        self.y: E = None
        self.x: E = None
        self.s: E = None
        self.t: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: B = None
        self.p: J = None
        self.s: J = None
        self.w: C = None
        self.u: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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