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

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: D = None
        self.p: J = None
        self.v: D = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: G = None
        self.y: B = None
        self.r: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.s: E = None
        self.p: B = None
        self.y: A = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.u: D = None
        self.p: J = None
        self.v: D = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: G = None
        self.y: B = None
        self.r: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: A = None
        self.s: E = None
        self.p: B = None
        self.y: A = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

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

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