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

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: F = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.u: A = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: J = None
        self.x: F = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.u: A = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.p: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.v: A = None
        self.txt = txt

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

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

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