class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: E = None
        self.v: C = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: F = None
        self.r: A = None
        self.o: C = None
        self.u: I = None
        self.t: F = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.s: B = None
        self.o: F = None
        self.x: J = None
        self.z: H = None
        self.r: J = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: E = None
        self.v: C = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: F = None
        self.r: A = None
        self.o: C = None
        self.u: I = None
        self.t: F = None
        self.v: C = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.s: B = None
        self.o: F = None
        self.x: J = None
        self.z: H = None
        self.r: J = None
        self.w: B = None
        self.txt = txt

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

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

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