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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: F = None
        self.r: A = None
        self.u: F = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.o: D = None
        self.s: A = None
        self.r: G = None
        self.p: G = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.y: A = None
        self.q: A = None
        self.u: H = None
        self.z: A = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: F = None
        self.r: A = None
        self.u: F = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: F = None
        self.o: D = None
        self.s: A = None
        self.r: G = None
        self.p: G = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.y: A = None
        self.q: A = None
        self.u: H = None
        self.z: A = None
        self.r: D = None
        self.v: F = None
        self.txt = txt

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

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

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