class A:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: H = None
        self.y: D = None
        self.u: H = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: I = None
        self.t: B = None
        self.q: F = None
        self.w: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: H = None
        self.y: E = None
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: H = None
        self.v: D = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

m = A("m")
e = B("e")
l = C("l")
g = D("g")
i = E("i")
k = F("k")
j = G("j")
h = H("h")
d = I("d")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: H = None
        self.y: D = None
        self.u: H = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: I = None
        self.t: B = None
        self.q: F = None
        self.w: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: H = None
        self.y: E = None
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: H = None
        self.v: D = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

m = A("m")
e = B("e")
l = C("l")
g = D("g")
i = E("i")
k = F("k")
j = G("j")
h = H("h")
d = I("d")
f = J("f")

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