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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: C = None
        self.q: A = None
        self.r: F = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.q: D = None
        self.r: B = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.z: C = None
        self.q: A = None
        self.r: F = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.q: D = None
        self.r: B = None
        self.t: F = None
        self.u: G = None
        self.txt = txt

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

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