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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: B = None
        self.x: A = None
        self.y: B = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: I = None
        self.w: B = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: H = None
        self.t: B = None
        self.s: H = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: B = None
        self.x: A = None
        self.y: B = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: I = None
        self.w: B = None
        self.r: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: H = None
        self.t: B = None
        self.s: H = None
        self.r: B = None
        self.txt = txt

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

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