class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: F = None
        self.w: J = None
        self.z: F = None
        self.q: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: H = None
        self.r: E = None
        self.w: J = None
        self.u: I = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: H = None
        self.w: H = None
        self.u: C = None
        self.z: H = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: H = None
        self.p: E = None
        self.r: E = None
        self.s: J = None
        self.o: J = None
        self.x: I = None
        self.u: C = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.p: H = None
        self.t: G = None
        self.v: B = None
        self.w: A = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: C = None
        self.o: G = None
        self.s: I = None
        self.txt = txt

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

b.v = m
b.x = d
b.z = d
b.w = f
b.q = c
l.o = f
k.u = m
k.s = n
a.s = l
a.v = l
a.q = n
a.r = m
a.w = f
a.u = c
m.q = f
m.t = n
m.w = n
m.z = n
m.u = k
m.v = k
d.w = f
d.s = f
d.o = f
d.y = n
d.p = m
d.r = m
d.x = c
d.u = k
d.z = k
g.y = l
g.s = n
g.v = d
n.t = k
c.u = b
c.w = b
c.q = a
c.p = n
c.t = g
c.x = g
c.v = l
f.q = n
f.x = k
f.o = g
f.s = c
assert m.z.t.s.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: F = None
        self.w: J = None
        self.z: F = None
        self.q: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: H = None
        self.r: E = None
        self.w: J = None
        self.u: I = None
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: H = None
        self.w: H = None
        self.u: C = None
        self.z: H = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.y: H = None
        self.p: E = None
        self.r: E = None
        self.s: J = None
        self.o: J = None
        self.x: I = None
        self.u: C = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.p: H = None
        self.t: G = None
        self.v: B = None
        self.w: A = None
        self.x: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: C = None
        self.o: G = None
        self.s: I = None
        self.txt = txt

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

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