class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: D = None
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.z: I = None
        self.t: G = None
        self.x: G = None
        self.u: A = None
        self.r: I = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: I = None
        self.z: D = None
        self.w: I = None
        self.y: C = None
        self.q: D = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.s: G = None
        self.x: A = None
        self.p: F = None
        self.u: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.z: I = None
        self.t: G = None
        self.x: G = None
        self.u: A = None
        self.r: I = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: I = None
        self.z: D = None
        self.w: I = None
        self.y: C = None
        self.q: D = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.s: G = None
        self.x: A = None
        self.p: F = None
        self.u: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

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