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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: I = None
        self.y: J = None
        self.t: A = None
        self.p: J = None
        self.u: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: E = None
        self.o: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: B = None
        self.u: A = None
        self.z: E = None
        self.w: E = None
        self.o: A = None
        self.v: B = None
        self.r: F = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: J = None
        self.x: B = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: I = None
        self.u: J = None
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: I = None
        self.r: H = None
        self.x: A = None
        self.v: I = None
        self.txt = txt

f = A("f")
n = B("n")
e = C("e")
k = D("k")
g = E("g")
i = F("i")
j = G("j")
h = H("h")
a = I("a")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: I = None
        self.y: J = None
        self.t: A = None
        self.p: J = None
        self.u: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: E = None
        self.o: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: B = None
        self.u: A = None
        self.z: E = None
        self.w: E = None
        self.o: A = None
        self.v: B = None
        self.r: F = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: J = None
        self.x: B = None
        self.z: A = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: I = None
        self.u: J = None
        self.p: H = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: H = None
        self.p: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: I = None
        self.r: H = None
        self.x: A = None
        self.v: I = None
        self.txt = txt

f = A("f")
n = B("n")
e = C("e")
k = D("k")
g = E("g")
i = F("i")
j = G("j")
h = H("h")
a = I("a")
m = J("m")

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