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

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: J = None
        self.x: F = None
        self.t: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: D = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: J = None
        self.x: F = None
        self.t: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: D = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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