class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: E = None
        self.s: I = None
        self.y: H = None
        self.u: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: J = None
        self.x: B = None
        self.w: J = None
        self.z: F = None
        self.r: B = None
        self.u: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: I = None
        self.q: C = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: I = None
        self.p: A = None
        self.y: D = None
        self.v: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.y: J = None
        self.x: B = None
        self.w: J = None
        self.z: F = None
        self.r: B = None
        self.u: D = None
        self.o: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: I = None
        self.q: C = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: I = None
        self.p: A = None
        self.y: D = None
        self.v: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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