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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.q: E = None
        self.u: D = None
        self.v: D = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: G = None
        self.p: C = None
        self.s: A = None
        self.x: E = None
        self.u: G = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: G = None
        self.q: E = None
        self.u: D = None
        self.v: D = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: G = None
        self.p: C = None
        self.s: A = None
        self.x: E = None
        self.u: G = None
        self.w: C = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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