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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: E = None
        self.z: A = None
        self.t: A = None
        self.p: H = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.t: C = None
        self.s: C = None
        self.v: B = None
        self.y: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: E = None
        self.z: A = None
        self.t: A = None
        self.p: H = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.t: C = None
        self.s: C = None
        self.v: B = None
        self.y: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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