class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: F = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: I = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: C = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: I = None
        self.s: A = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: J = None
        self.t: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: C = None
        self.z: H = None
        self.txt = txt

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

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