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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.t: G = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.s: J = None
        self.w: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: A = None
        self.o: C = None
        self.y: J = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
i = D("i")
j = E("j")
h = F("h")
e = G("e")
n = H("n")
d = I("d")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: E = None
        self.t: G = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: H = None
        self.s: J = None
        self.w: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: A = None
        self.o: C = None
        self.y: J = None
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

f = A("f")
b = B("b")
a = C("a")
i = D("i")
j = E("j")
h = F("h")
e = G("e")
n = H("n")
d = I("d")
m = J("m")

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