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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: J = None
        self.r: D = None
        self.v: A = None
        self.s: D = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.w: E = None
        self.u: B = None
        self.t: H = None
        self.q: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: J = None
        self.r: D = None
        self.v: A = None
        self.s: D = None
        self.p: A = None
        self.y: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: G = None
        self.w: E = None
        self.u: B = None
        self.t: H = None
        self.q: I = None
        self.txt = txt

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

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