class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: F = None
        self.w: B = None
        self.y: G = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.x: D = None
        self.r: B = None
        self.txt = txt

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

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