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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: C = None
        self.v: H = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: C = None
        self.v: H = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.z: D = None
        self.txt = txt

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

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

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

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