class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: H = None
        self.x: F = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.w: D = None
        self.r: D = None
        self.s: B = None
        self.x: F = None
        self.p: E = None
        self.v: G = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.s: B = None
        self.u: F = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: E = None
        self.w: A = None
        self.t: A = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: A = None
        self.r: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.r: B = None
        self.v: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: H = None
        self.x: F = None
        self.q: D = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: E = None
        self.w: D = None
        self.r: D = None
        self.s: B = None
        self.x: F = None
        self.p: E = None
        self.v: G = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: G = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: J = None
        self.s: B = None
        self.u: F = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: E = None
        self.w: A = None
        self.t: A = None
        self.v: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: A = None
        self.r: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: E = None
        self.r: B = None
        self.v: I = None
        self.txt = txt

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

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