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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.x: B = None
        self.p: C = None
        self.q: F = None
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: C = None
        self.p: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: A = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: A = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: A = None
        self.x: B = None
        self.p: C = None
        self.q: F = None
        self.s: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.t: C = None
        self.p: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.u: A = None
        self.w: D = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: A = None
        self.q: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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