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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

n = A("n")
e = B("e")
g = C("g")
c = D("c")
a = E("a")
l = F("l")
b = G("b")
i = H("i")
k = H("k")

n.s = e
n.w = a
n.v = c
e.r = c
e.s = a
g.s = k
g.z = b
c.p = a
a.w = e
l.t = n
b.v = e
i.s = g
i.o = b
i.q = e
i.v = k
i.p = c
i.z = a
k.s = g
k.o = b
k.q = e
k.v = i
k.p = c
k.z = a
assert b.v.r.p.w.s.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: E = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: G = None
        self.txt = txt

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

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

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

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

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

n = A("n")
e = B("e")
g = C("g")
c = D("c")
a = E("a")
l = F("l")
b = G("b")
i = H("i")
k = H("k")

n.s = e
n.w = a
n.v = c
e.r = c
e.s = a
g.s = k
g.z = b
c.p = a
a.w = e
l.t = n
b.v = e
i.s = g
i.o = b
i.q = e
i.v = k
i.p = c
i.z = a
k.s = g
k.o = b
k.q = e
k.v = i
k.p = c
k.z = a
assert b.v.r.p.w.s.w.r.txt == "c"