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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.x: A = None
        self.r: H = None
        self.y: A = None
        self.o: E = None
        self.q: H = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.q: G = None
        self.o: G = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: H = None
        self.r: E = None
        self.p: H = None
        self.z: H = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.x: A = None
        self.r: H = None
        self.y: A = None
        self.o: E = None
        self.q: H = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.q: G = None
        self.o: G = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: H = None
        self.r: E = None
        self.p: H = None
        self.z: H = None
        self.o: E = None
        self.txt = txt

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

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

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