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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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