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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: H = None
        self.w: G = None
        self.y: I = None
        self.t: J = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: H = None
        self.x: F = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: J = None
        self.w: J = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.t: J = None
        self.s: E = None
        self.q: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: E = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.o: H = None
        self.w: G = None
        self.y: I = None
        self.t: J = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: H = None
        self.x: F = None
        self.w: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: J = None
        self.w: J = None
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.t: J = None
        self.s: E = None
        self.q: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: E = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

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

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

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