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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.u: B = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: C = None
        self.u: B = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

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

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

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