class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: F = None
        self.o: D = None
        self.q: C = None
        self.s: B = None
        self.p: I = None
        self.x: I = None
        self.z: D = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: I = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: G = None
        self.u: B = None
        self.v: I = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.y: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: I = None
        self.w: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: G = None
        self.u: B = None
        self.v: I = None
        self.r: A = None
        self.txt = txt

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

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