class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: J = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: F = None
        self.u: C = None
        self.o: J = None
        self.t: F = None
        self.p: I = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: F = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.t: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: F = None
        self.txt = txt

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

n.q = j
n.v = j
n.p = l
n.y = k
j.v = m
j.r = a
j.t = a
j.u = f
j.o = l
j.p = d
j.y = i
f.o = n
f.w = n
f.y = a
f.q = b
k.x = j
k.s = m
b.r = k
b.s = k
b.u = i
b.w = i
b.q = j
b.v = a
b.t = a
a.v = l
i.s = f
m.p = d
m.r = d
d.s = b
d.v = m
d.t = n
l.t = n
l.v = a
assert m.r.v.r.t.p.v.v.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: J = None
        self.v: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: F = None
        self.u: C = None
        self.o: J = None
        self.t: F = None
        self.p: I = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: F = None
        self.w: A = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: H = None
        self.t: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: F = None
        self.txt = txt

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

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