class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: B = None
        self.z: B = None
        self.v: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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