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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: E = None
        self.v: B = None
        self.z: B = None
        self.q: I = None
        self.s: H = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: H = None
        self.x: B = None
        self.p: G = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: D = None
        self.o: C = None
        self.s: J = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: H = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: E = None
        self.v: B = None
        self.z: B = None
        self.q: I = None
        self.s: H = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: H = None
        self.x: B = None
        self.p: G = None
        self.r: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: D = None
        self.o: C = None
        self.s: J = None
        self.y: D = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: H = None
        self.s: E = None
        self.t: E = None
        self.txt = txt

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

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