class A:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: G = None
        self.y: A = None
        self.o: B = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.p: I = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.r: F = None
        self.x: B = None
        self.z: H = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: G = None
        self.u: C = None
        self.o: I = None
        self.z: H = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: G = None
        self.y: A = None
        self.o: B = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.p: I = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.r: F = None
        self.x: B = None
        self.z: H = None
        self.q: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: G = None
        self.u: C = None
        self.o: I = None
        self.z: H = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: H = None
        self.z: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: D = None
        self.v: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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