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

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

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: F = None
        self.v: B = None
        self.r: G = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: F = None
        self.z: A = None
        self.u: H = None
        self.q: A = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: G = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: F = None
        self.v: B = None
        self.r: G = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.v: F = None
        self.z: A = None
        self.u: H = None
        self.q: A = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: G = None
        self.z: E = None
        self.q: A = None
        self.txt = txt

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

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