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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.t: D = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: C = None
        self.t: D = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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