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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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