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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: C = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.y: D = None
        self.s: D = None
        self.q: F = None
        self.z: H = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.r: H = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

g = A("g")
d = B("d")
e = C("e")
f = D("f")
a = E("a")
h = F("h")
c = G("c")
n = H("n")

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: C = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: F = None
        self.y: D = None
        self.s: D = None
        self.q: F = None
        self.z: H = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.r: H = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: B = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

g = A("g")
d = B("d")
e = C("e")
f = D("f")
a = E("a")
h = F("h")
c = G("c")
n = H("n")

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