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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: F = None
        self.z: C = None
        self.v: J = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.v: E = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: F = None
        self.z: C = None
        self.v: J = None
        self.s: B = None
        self.txt = txt

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

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

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

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