class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: C = None
        self.w: B = None
        self.z: B = None
        self.r: C = None
        self.s: B = None
        self.t: D = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.x: G = None
        self.p: E = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.o: F = None
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.x: G = None
        self.p: E = None
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.o: F = None
        self.t: H = None
        self.txt = txt

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

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