class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.u: H = None
        self.y: F = None
        self.o: G = None
        self.w: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.x: C = None
        self.q: G = None
        self.s: C = None
        self.z: B = 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.z: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: E = None
        self.u: H = None
        self.y: F = None
        self.o: G = None
        self.w: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: E = None
        self.x: C = None
        self.q: G = None
        self.s: C = None
        self.z: B = 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.z: H = None
        self.txt = txt

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

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

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

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