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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.v: H = None
        self.p: D = None
        self.y: B = None
        self.u: A = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.q: E = None
        self.r: H = None
        self.o: I = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: A = None
        self.r: C = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.t: B = None
        self.x: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.v: H = None
        self.p: D = None
        self.y: B = None
        self.u: A = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.q: E = None
        self.r: H = None
        self.o: I = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: A = None
        self.r: C = None
        self.p: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.t: B = None
        self.x: H = None
        self.txt = txt

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

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