class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: G = None
        self.r: F = None
        self.o: B = None
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: C = None
        self.q: G = None
        self.t: A = None
        self.z: I = None
        self.u: A = None
        self.s: H = None
        self.w: F = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: G = None
        self.r: F = None
        self.o: B = None
        self.q: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: C = None
        self.q: G = None
        self.t: A = None
        self.z: I = None
        self.u: A = None
        self.s: H = None
        self.w: F = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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