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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: J = None
        self.z: J = None
        self.y: I = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.w: D = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: C = None
        self.o: D = None
        self.p: G = None
        self.w: G = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: J = None
        self.z: J = None
        self.y: I = None
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.w: D = None
        self.o: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: C = None
        self.o: D = None
        self.p: G = None
        self.w: G = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

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

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