class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: D = None
        self.q: C = None
        self.r: D = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.o: F = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: J = None
        self.u: H = None
        self.t: H = None
        self.v: A = None
        self.w: A = None
        self.o: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: G = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: F = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: F = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: B = None
        self.o: F = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: J = None
        self.u: H = None
        self.t: H = None
        self.v: A = None
        self.w: A = None
        self.o: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: G = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: F = None
        self.z: B = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: F = None
        self.v: G = None
        self.txt = txt

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

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

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