class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: J = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: B = None
        self.o: A = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: J = None
        self.y: D = None
        self.z: E = None
        self.u: I = None
        self.t: A = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: I = None
        self.o: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.w: C = None
        self.o: E = None
        self.y: G = None
        self.p: J = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: B = None
        self.o: A = None
        self.z: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: J = None
        self.y: D = None
        self.z: E = None
        self.u: I = None
        self.t: A = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: I = None
        self.o: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: G = None
        self.w: C = None
        self.o: E = None
        self.y: G = None
        self.p: J = None
        self.txt = txt

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

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

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