class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.y: G = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: I = None
        self.v: J = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.v: F = None
        self.o: D = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: E = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: E = None
        self.y: G = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: I = None
        self.v: J = None
        self.o: E = None
        self.r: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.v: F = None
        self.o: D = None
        self.z: D = None
        self.txt = txt

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

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