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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: C = None
        self.w: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.w: G = None
        self.q: J = None
        self.y: D = None
        self.x: I = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: C = None
        self.w: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.w: G = None
        self.q: J = None
        self.y: D = None
        self.x: I = None
        self.txt = txt

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

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

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

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