class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.w: A = None
        self.o: F = None
        self.t: A = None
        self.u: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

e = A("e")
d = B("d")
m = C("m")
c = D("c")
n = E("n")
l = F("l")
g = G("g")
h = H("h")

e.y = l
e.z = l
e.x = n
d.z = l
d.q = l
d.x = m
d.r = m
d.w = n
d.u = n
d.y = c
d.o = c
m.y = c
m.v = e
m.z = h
c.x = e
c.w = e
c.t = e
c.v = l
c.o = l
c.u = l
c.r = h
n.w = d
n.v = c
n.z = c
n.q = m
l.r = m
g.r = d
g.u = e
h.s = g
h.t = e
h.x = e
h.v = e
h.q = m
h.p = n
h.y = n
h.w = c
assert n.q.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.w: A = None
        self.o: F = None
        self.t: A = None
        self.u: F = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: D = None
        self.q: C = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.txt = txt

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

e = A("e")
d = B("d")
m = C("m")
c = D("c")
n = E("n")
l = F("l")
g = G("g")
h = H("h")

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