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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: A = None
        self.z: G = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: H = None
        self.r: F = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.o: I = None
        self.r: E = None
        self.z: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: G = None
        self.u: B = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: A = None
        self.z: G = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: H = None
        self.r: F = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: D = None
        self.o: I = None
        self.r: E = None
        self.z: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: G = None
        self.u: B = None
        self.q: E = None
        self.x: D = None
        self.txt = txt

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

m.z = f
d.x = n
d.z = n
d.u = m
d.s = e
g.v = k
g.z = b
g.r = e
g.q = m
c.p = k
c.x = h
c.s = f
k.q = f
k.z = h
k.s = c
e.x = m
n.x = f
n.u = g
n.p = g
b.p = h
b.o = h
b.z = h
b.x = c
b.r = k
h.v = d
h.q = d
h.p = f
h.s = b
h.x = b
h.u = k
h.o = c
h.z = n
h.y = n
f.z = e
f.y = n
f.u = d
f.q = k
f.x = c
assert f.x.x.q.x.u.v.txt == "k"