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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: J = None
        self.w: A = None
        self.u: C = None
        self.z: E = None
        self.v: E = None
        self.s: D = None
        self.o: E = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: E = None
        self.o: F = None
        self.x: H = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: J = None
        self.w: A = None
        self.u: C = None
        self.z: E = None
        self.v: E = None
        self.s: D = None
        self.o: E = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: E = None
        self.o: F = None
        self.x: H = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: I = None
        self.txt = txt

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

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