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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

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

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