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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.r: A = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

h = A("h")
i = B("i")
b = C("b")
l = D("l")
c = E("c")
f = F("f")
d = G("d")
g = H("g")
a = I("a")
e = J("e")

h.o = e
i.x = a
i.o = g
i.v = h
i.s = h
i.z = b
i.r = f
i.t = f
i.p = e
b.o = e
l.p = d
l.x = d
l.z = g
l.o = c
l.s = e
l.q = e
l.y = e
l.w = h
l.t = f
c.r = b
c.y = f
c.v = g
f.x = g
d.z = l
d.p = l
d.s = l
d.w = i
d.r = g
d.x = a
g.r = e
g.s = e
a.z = f
a.u = d
a.y = d
a.r = h
a.w = c
e.x = a
assert d.x.z.x.r.x.w.y.x.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: G = None
        self.r: A = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

h = A("h")
i = B("i")
b = C("b")
l = D("l")
c = E("c")
f = F("f")
d = G("d")
g = H("g")
a = I("a")
e = J("e")

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