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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.p: B = None
        self.u: H = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: A = None
        self.x: E = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: A = None
        self.u: D = None
        self.z: B = None
        self.o: C = None
        self.s: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.p: B = None
        self.u: H = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.s: A = None
        self.x: E = None
        self.t: F = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: A = None
        self.u: D = None
        self.z: B = None
        self.o: C = None
        self.s: D = None
        self.x: B = None
        self.txt = txt

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

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

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