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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: A = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.v: C = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

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

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

m.v = k
m.y = k
i.u = k
i.r = f
h.r = k
h.u = m
h.q = g
h.z = g
a.r = f
g.w = h
b.u = i
b.y = a
b.v = h
b.q = f
b.s = f
f.t = k
f.q = m
k.y = a
k.s = a
k.r = g
k.w = b
k.x = j
k.z = h
k.q = m
j.u = i
j.y = a
j.v = h
j.q = f
j.s = f
assert g.w.z.w.z.w.u.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: A = None
        self.q: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: D = None
        self.v: C = None
        self.q: G = None
        self.s: G = None
        self.txt = txt

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

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

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

m.v = k
m.y = k
i.u = k
i.r = f
h.r = k
h.u = m
h.q = g
h.z = g
a.r = f
g.w = h
b.u = i
b.y = a
b.v = h
b.q = f
b.s = f
f.t = k
f.q = m
k.y = a
k.s = a
k.r = g
k.w = b
k.x = j
k.z = h
k.q = m
j.u = i
j.y = a
j.v = h
j.q = f
j.s = f
assert g.w.z.w.z.w.u.y.r.txt == "g"