class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: C = None
        self.y: I = None
        self.t: G = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: E = None
        self.s: A = None
        self.y: F = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: J = None
        self.x: B = None
        self.q: F = None
        self.v: J = None
        self.y: E = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: H = None
        self.u: E = None
        self.v: I = None
        self.r: B = None
        self.t: H = None
        self.x: I = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: E = None
        self.x: A = None
        self.r: D = None
        self.v: I = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: J = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: I = None
        self.q: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: E = None
        self.s: A = None
        self.y: F = None
        self.r: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: J = None
        self.x: B = None
        self.q: F = None
        self.v: J = None
        self.y: E = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: H = None
        self.u: E = None
        self.v: I = None
        self.r: B = None
        self.t: H = None
        self.x: I = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: E = None
        self.x: A = None
        self.r: D = None
        self.v: I = None
        self.q: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: J = None
        self.t: D = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: I = None
        self.q: H = None
        self.txt = txt

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

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