class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: E = None
        self.r: G = None
        self.t: D = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.q: F = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: F = None
        self.v: E = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: A = None
        self.s: A = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.q: F = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: F = None
        self.v: E = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: A = None
        self.s: A = None
        self.t: B = None
        self.txt = txt

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

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