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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.z: G = None
        self.s: G = None
        self.q: J = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.x: A = None
        self.q: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.z: G = None
        self.s: G = None
        self.q: J = None
        self.y: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.x: A = None
        self.q: J = None
        self.txt = txt

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

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

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