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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.p: B = None
        self.t: G = None
        self.w: H = None
        self.q: C = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.o: F = None
        self.u: B = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.x: D = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: B = None
        self.p: B = None
        self.t: G = None
        self.w: H = None
        self.q: C = None
        self.z: C = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: C = None
        self.o: F = None
        self.u: B = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.x: D = None
        self.q: H = None
        self.txt = txt

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

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

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

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