class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: G = None
        self.s: G = None
        self.w: F = None
        self.t: G = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: D = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.u: D = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: D = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: F = None
        self.o: A = None
        self.txt = txt

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

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

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