class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: E = None
        self.t: B = None
        self.z: G = None
        self.u: C = None
        self.s: J = None
        self.r: J = None
        self.x: C = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: F = None
        self.q: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: A = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: J = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: A = None
        self.y: J = None
        self.x: C = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

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

h.q = m
h.p = j
h.t = a
h.z = g
h.y = g
h.u = n
h.x = n
h.s = b
h.r = b
a.v = m
a.t = m
a.q = b
n.o = a
i.t = k
i.z = h
i.v = h
i.s = j
j.v = h
j.z = a
j.u = n
m.q = g
m.r = k
m.x = j
m.p = i
m.y = b
g.p = h
g.y = b
g.u = n
k.t = g
e.o = b
e.y = b
e.p = h
e.r = h
e.x = n
e.u = k
b.r = g
assert b.r.u.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: E = None
        self.t: B = None
        self.z: G = None
        self.u: C = None
        self.s: J = None
        self.r: J = None
        self.x: C = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: F = None
        self.q: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: A = None
        self.v: A = None
        self.s: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: J = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: A = None
        self.y: J = None
        self.x: C = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

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

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