class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.z: H = None
        self.t: C = None
        self.r: H = None
        self.o: B = None
        self.x: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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