class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: C = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: C = None
        self.x: H = None
        self.p: J = None
        self.t: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: C = None
        self.x: A = None
        self.z: E = None
        self.u: D = None
        self.r: C = None
        self.p: I = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: C = None
        self.r: C = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: C = None
        self.x: H = None
        self.p: J = None
        self.t: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: C = None
        self.x: A = None
        self.z: E = None
        self.u: D = None
        self.r: C = None
        self.p: I = None
        self.txt = txt

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

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