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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.z: J = None
        self.u: J = None
        self.q: G = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: H = None
        self.v: A = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.o: H = None
        self.t: C = None
        self.r: C = None
        self.u: F = None
        self.q: H = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.r: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: B = None
        self.u: B = None
        self.p: I = None
        self.v: D = None
        self.r: B = None
        self.x: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.z: J = None
        self.u: J = None
        self.q: G = None
        self.r: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: H = None
        self.v: A = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: E = None
        self.o: H = None
        self.t: C = None
        self.r: C = None
        self.u: F = None
        self.q: H = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: C = None
        self.r: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.o: B = None
        self.u: B = None
        self.p: I = None
        self.v: D = None
        self.r: B = None
        self.x: I = None
        self.txt = txt

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

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