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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: I = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: G = None
        self.w: I = None
        self.y: G = None
        self.r: A = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.u: F = None
        self.t: H = None
        self.y: H = None
        self.z: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: I = None
        self.y: G = None
        self.r: C = None
        self.z: J = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: E = None
        self.o: I = None
        self.s: H = None
        self.u: C = None
        self.t: B = None
        self.v: G = None
        self.z: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: I = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: G = None
        self.w: I = None
        self.y: G = None
        self.r: A = None
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.u: F = None
        self.t: H = None
        self.y: H = None
        self.z: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: I = None
        self.y: G = None
        self.r: C = None
        self.z: J = None
        self.v: D = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: B = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.r: E = None
        self.o: I = None
        self.s: H = None
        self.u: C = None
        self.t: B = None
        self.v: G = None
        self.z: H = None
        self.txt = txt

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

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