class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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