class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: H = None
        self.p: E = None
        self.s: E = None
        self.t: J = None
        self.u: C = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: E = None
        self.x: E = None
        self.p: J = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: J = None
        self.y: H = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: I = None
        self.o: F = None
        self.txt = txt

k = A("k")
h = B("h")
m = C("m")
e = D("e")
c = E("c")
l = F("l")
j = G("j")
b = H("b")
i = I("i")
n = J("n")

k.o = l
k.z = l
k.q = b
k.p = c
k.s = c
k.y = c
k.t = n
k.u = m
h.z = n
h.o = b
h.y = k
m.p = n
m.u = l
m.q = j
m.w = h
e.z = n
e.u = b
c.o = n
l.q = n
l.u = n
l.s = n
l.w = e
l.x = e
l.v = e
l.z = b
l.r = m
j.y = i
j.r = c
j.x = c
j.p = n
j.u = e
j.s = m
b.s = e
b.z = l
b.x = c
i.w = e
i.x = n
i.y = b
i.p = k
i.u = h
n.x = i
n.w = i
n.o = l
assert m.u.r.w.z.w.u.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: H = None
        self.p: E = None
        self.s: E = None
        self.t: J = None
        self.u: C = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: E = None
        self.x: E = None
        self.p: J = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: J = None
        self.y: H = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.w: I = None
        self.o: F = None
        self.txt = txt

k = A("k")
h = B("h")
m = C("m")
e = D("e")
c = E("c")
l = F("l")
j = G("j")
b = H("b")
i = I("i")
n = J("n")

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