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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: C = None
        self.v: A = None
        self.w: G = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: J = None
        self.t: G = None
        self.z: D = None
        self.v: J = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.z: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: C = None
        self.v: A = None
        self.w: G = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: J = None
        self.t: G = None
        self.z: D = None
        self.v: J = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: A = None
        self.z: D = None
        self.v: E = None
        self.txt = txt

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

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

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

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