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

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

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: A = None
        self.o: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: I = None
        self.q: G = None
        self.r: G = None
        self.y: F = None
        self.z: E = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: A = None
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: D = None
        self.t: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: A = None
        self.o: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: I = None
        self.q: G = None
        self.r: G = None
        self.y: F = None
        self.z: E = None
        self.x: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: A = None
        self.x: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: D = None
        self.t: G = None
        self.z: C = None
        self.txt = txt

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

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