class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: F = None
        self.s: E = None
        self.z: H = None
        self.y: F = None
        self.t: D = None
        self.p: H = None
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: J = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: I = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: G = None
        self.q: A = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.o: D = None
        self.r: E = None
        self.txt = txt

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

c.q = h
c.z = h
c.p = h
c.r = e
c.y = e
c.x = e
c.s = n
c.t = m
k.s = h
k.y = m
k.u = n
k.o = j
k.t = c
k.p = l
d.o = e
m.o = h
m.y = b
m.x = e
n.o = d
n.r = j
n.w = j
n.v = l
e.s = c
e.o = h
e.w = h
e.t = l
e.y = m
e.r = b
e.x = b
e.p = j
l.q = k
h.t = c
h.q = c
h.y = l
h.w = m
h.x = d
j.s = b
j.v = b
j.t = c
j.z = n
j.p = m
b.u = l
b.s = l
b.o = m
b.r = n
assert j.z.w.v.r.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: F = None
        self.s: E = None
        self.z: H = None
        self.y: F = None
        self.t: D = None
        self.p: H = None
        self.x: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: J = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: I = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: G = None
        self.q: A = None
        self.w: D = None
        self.x: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.o: D = None
        self.r: E = None
        self.txt = txt

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

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