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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.v: A = None
        self.z: F = None
        self.p: F = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: F = None
        self.x: D = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: D = None
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: D = None
        self.v: A = None
        self.z: F = None
        self.p: F = None
        self.t: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: F = None
        self.x: D = None
        self.r: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: D = None
        self.w: G = None
        self.txt = txt

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

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