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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: D = None
        self.y: H = None
        self.x: G = None
        self.w: G = None
        self.v: G = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.p: H = None
        self.s: G = None
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: B = None
        self.q: D = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.o: A = None
        self.v: F = None
        self.y: A = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: D = None
        self.y: H = None
        self.x: G = None
        self.w: G = None
        self.v: G = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: B = None
        self.p: H = None
        self.s: G = None
        self.o: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: B = None
        self.q: D = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.o: A = None
        self.v: F = None
        self.y: A = None
        self.r: A = None
        self.x: A = None
        self.txt = txt

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

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