class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: H = None
        self.q: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: H = None
        self.q: F = None
        self.u: G = None
        self.z: F = None
        self.y: H = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: G = None
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: H = None
        self.q: F = None
        self.u: G = None
        self.z: F = None
        self.y: H = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: G = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.w: H = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: G = None
        self.p: G = None
        self.txt = txt

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

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