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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: G = None
        self.y: A = None
        self.u: H = None
        self.p: D = None
        self.z: G = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: C = None
        self.o: C = None
        self.y: C = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

n = A("n")
h = B("h")
a = C("a")
d = D("d")
j = E("j")
l = F("l")
m = G("m")
i = H("i")
k = E("k")

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: G = None
        self.y: A = None
        self.u: H = None
        self.p: D = None
        self.z: G = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: C = None
        self.o: C = None
        self.y: C = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: F = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

n = A("n")
h = B("h")
a = C("a")
d = D("d")
j = E("j")
l = F("l")
m = G("m")
i = H("i")
k = E("k")

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