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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: F = None
        self.z: C = None
        self.q: H = None
        self.s: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: D = None
        self.o: A = None
        self.z: E = None
        self.p: F = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: D = None
        self.w: B = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: F = None
        self.z: C = None
        self.q: H = None
        self.s: A = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: D = None
        self.o: A = None
        self.z: E = None
        self.p: F = None
        self.x: C = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: D = None
        self.w: B = None
        self.y: D = None
        self.txt = txt

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

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