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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: F = None
        self.p: J = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.q: B = None
        self.x: J = None
        self.r: J = None
        self.u: G = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: B = None
        self.r: B = None
        self.w: A = None
        self.o: I = None
        self.s: F = None
        self.q: I = None
        self.y: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: F = None
        self.p: J = None
        self.z: H = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.q: B = None
        self.x: J = None
        self.r: J = None
        self.u: G = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: B = None
        self.r: B = None
        self.w: A = None
        self.o: I = None
        self.s: F = None
        self.q: I = None
        self.y: C = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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