class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: C = None
        self.q: C = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.z: F = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.o: H = None
        self.r: B = None
        self.p: A = None
        self.x: A = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.z: F = None
        self.x: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: C = None
        self.o: H = None
        self.r: B = None
        self.p: A = None
        self.x: A = None
        self.s: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: E = None
        self.txt = txt

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

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

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