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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: D = None
        self.p: C = None
        self.x: H = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.o: C = None
        self.r: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: D = None
        self.p: C = None
        self.x: H = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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