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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: G = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.w: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.o: E = None
        self.x: C = None
        self.t: F = None
        self.u: F = None
        self.y: B = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: G = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: E = None
        self.w: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.o: E = None
        self.x: C = None
        self.t: F = None
        self.u: F = None
        self.y: B = None
        self.p: A = None
        self.txt = txt

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

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