class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: F = None
        self.s: E = None
        self.z: I = None
        self.x: D = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: C = None
        self.p: H = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: G = None
        self.t: D = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: F = None
        self.w: H = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.w: E = None
        self.u: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: F = None
        self.s: E = None
        self.z: I = None
        self.x: D = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: J = None
        self.q: C = None
        self.p: H = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: G = None
        self.t: D = None
        self.r: B = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: F = None
        self.w: H = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: A = None
        self.w: E = None
        self.u: I = None
        self.txt = txt

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

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

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

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