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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.q: C = None
        self.z: A = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: G = None
        self.u: B = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.o: C = None
        self.x: I = None
        self.y: I = None
        self.t: J = None
        self.u: C = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: E = None
        self.u: D = None
        self.y: D = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: H = None
        self.p: E = None
        self.v: C = None
        self.x: J = None
        self.t: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.z: I = None
        self.u: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.q: C = None
        self.z: A = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: G = None
        self.u: B = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.o: C = None
        self.x: I = None
        self.y: I = None
        self.t: J = None
        self.u: C = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: E = None
        self.u: D = None
        self.y: D = None
        self.o: H = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: H = None
        self.p: E = None
        self.v: C = None
        self.x: J = None
        self.t: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: H = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: D = None
        self.z: I = None
        self.u: I = None
        self.txt = txt

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

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