class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.y: D = None
        self.r: E = None
        self.v: D = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: E = None
        self.q: G = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.o: E = None
        self.p: H = None
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: F = None
        self.p: F = None
        self.s: F = None
        self.v: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: E = None
        self.q: G = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.o: E = None
        self.p: H = None
        self.w: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: F = None
        self.p: F = None
        self.s: F = None
        self.v: F = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: G = None
        self.txt = txt

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

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