class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: I = None
        self.s: E = None
        self.t: J = None
        self.y: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.q: G = None
        self.p: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: I = None
        self.s: E = None
        self.t: J = None
        self.y: A = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.q: G = None
        self.p: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

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

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