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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: G = None
        self.z: A = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.x: H = None
        self.z: E = None
        self.txt = txt

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

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

h.o = i
h.v = i
h.y = f
h.w = n
f.o = l
f.t = l
f.z = h
f.v = h
f.s = m
g.o = l
i.x = h
i.q = h
i.v = h
i.r = m
i.o = l
i.z = l
i.y = l
i.w = f
n.q = f
n.z = h
m.r = h
m.z = h
m.v = g
m.u = g
l.q = n
l.z = n
l.v = g
l.x = j
j.q = h
assert n.q.v.w.q.z.w.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.y: B = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.t: G = None
        self.z: A = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: C = None
        self.x: H = None
        self.z: E = None
        self.txt = txt

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

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

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