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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: F = None
        self.o: C = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: G = None
        self.u: H = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: H = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.s: G = None
        self.x: E = None
        self.w: D = None
        self.t: H = None
        self.r: E = None
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.z: F = None
        self.o: C = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: G = None
        self.u: H = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: H = None
        self.w: G = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: G = None
        self.s: G = None
        self.x: E = None
        self.w: D = None
        self.t: H = None
        self.r: E = None
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.p: B = None
        self.v: D = None
        self.txt = txt

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

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