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

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

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: H = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.p: I = None
        self.q: C = None
        self.r: D = None
        self.v: C = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: I = None
        self.p: A = None
        self.y: E = None
        self.v: J = None
        self.z: E = None
        self.o: B = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: H = None
        self.y: H = None
        self.r: H = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: H = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.p: I = None
        self.q: C = None
        self.r: D = None
        self.v: C = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: J = None
        self.t: I = None
        self.p: A = None
        self.y: E = None
        self.v: J = None
        self.z: E = None
        self.o: B = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: H = None
        self.y: H = None
        self.r: H = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

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

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

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