class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.u: E = None
        self.p: H = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: E = None
        self.q: J = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.w: E = None
        self.t: F = None
        self.x: H = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.u: E = None
        self.p: H = None
        self.s: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: E = None
        self.q: J = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: A = None
        self.w: E = None
        self.t: F = None
        self.x: H = None
        self.r: E = None
        self.txt = txt

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

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

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