class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: J = None
        self.o: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: F = None
        self.r: B = None
        self.s: I = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.o: C = None
        self.x: F = None
        self.v: B = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.t: E = None
        self.s: H = None
        self.o: G = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: J = None
        self.o: A = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: F = None
        self.r: B = None
        self.s: I = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: H = None
        self.o: C = None
        self.x: F = None
        self.v: B = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: A = None
        self.t: E = None
        self.s: H = None
        self.o: G = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.v: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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