class A:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: D = None
        self.y: H = None
        self.x: H = None
        self.q: H = None
        self.t: E = None
        self.u: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.p: C = None
        self.z: E = None
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.p: F = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.p: C = None
        self.z: E = None
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.p: F = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

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