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

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

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

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.w: I = None
        self.p: C = None
        self.z: A = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.p: D = None
        self.t: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.s: G = None
        self.txt = txt

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

k.q = f
k.y = f
k.r = n
k.w = a
k.o = a
k.s = m
k.p = m
k.t = h
k.v = h
k.u = b
l.w = e
l.u = e
m.s = l
f.u = e
f.w = a
f.s = a
f.p = m
f.z = k
b.u = f
b.v = f
b.p = f
b.t = n
g.z = n
h.q = k
h.s = m
n.q = g
n.z = g
a.s = b
a.r = n
e.r = m
e.u = m
e.s = h
assert m.s.u.s.s.s.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: H = None
        self.w: I = None
        self.s: C = None
        self.t: G = None
        self.o: I = None
        self.p: C = None
        self.v: G = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.w: I = None
        self.p: C = None
        self.z: A = None
        self.s: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.p: D = None
        self.t: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.s: G = None
        self.txt = txt

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

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