class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.u: D = None
        self.s: J = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.z: H = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.v: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.v: D = None
        self.w: F = None
        self.x: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: B = None
        self.p: C = None
        self.t: F = None
        self.v: I = None
        self.u: G = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: G = None
        self.v: F = None
        self.r: D = None
        self.t: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.u: D = None
        self.s: J = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.z: H = None
        self.t: A = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: E = None
        self.v: C = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.v: D = None
        self.w: F = None
        self.x: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: B = None
        self.p: C = None
        self.t: F = None
        self.v: I = None
        self.u: G = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: G = None
        self.v: F = None
        self.r: D = None
        self.t: G = None
        self.txt = txt

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

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