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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: B = None
        self.x: B = None
        self.t: F = None
        self.q: F = None
        self.u: G = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.u: B = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: B = None
        self.x: B = None
        self.t: F = None
        self.q: F = None
        self.u: G = None
        self.p: F = None
        self.txt = txt

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

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