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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: F = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

e = A("e")
c = B("c")
m = C("m")
a = D("a")
g = E("g")
i = F("i")
d = G("d")
h = H("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: F = None
        self.v: C = None
        self.q: E = None
        self.txt = txt

e = A("e")
c = B("c")
m = C("m")
a = D("a")
g = E("g")
i = F("i")
d = G("d")
h = H("h")

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