class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.u: E = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.txt = txt

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

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

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

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