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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.q: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: F = None
        self.p: F = None
        self.v: B = None
        self.z: F = None
        self.s: I = None
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.q: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: F = None
        self.p: F = None
        self.v: B = None
        self.z: F = None
        self.s: I = None
        self.u: G = None
        self.txt = txt

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

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