class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: D = None
        self.y: D = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.t: H = None
        self.v: A = None
        self.q: H = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: H = None
        self.r: C = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.z: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.t: H = None
        self.v: A = None
        self.q: H = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: H = None
        self.r: C = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: C = None
        self.z: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: G = None
        self.txt = txt

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

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