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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: H = None
        self.o: C = None
        self.r: B = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.p: D = None
        self.r: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: H = None
        self.o: C = None
        self.r: B = None
        self.s: C = None
        self.txt = txt

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

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

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