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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.r: A = None
        self.s: J = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.v: E = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: B = None
        self.t: I = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: J = None
        self.u: H = None
        self.x: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: D = None
        self.y: D = None
        self.w: G = None
        self.r: B = None
        self.z: H = None
        self.q: A = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.r: A = None
        self.s: J = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.v: E = None
        self.u: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: B = None
        self.t: I = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: J = None
        self.u: H = None
        self.x: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: D = None
        self.y: D = None
        self.w: G = None
        self.r: B = None
        self.z: H = None
        self.q: A = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

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

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

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