class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: D = None
        self.x: C = None
        self.z: C = None
        self.p: C = None
        self.t: I = None
        self.r: F = None
        self.y: I = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: D = None
        self.v: B = None
        self.r: I = None
        self.p: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: F = None
        self.t: I = None
        self.o: I = None
        self.u: J = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.y: B = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.t: C = None
        self.u: I = None
        self.z: D = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: D = None
        self.t: F = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.w: A = None
        self.y: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: E = None
        self.q: D = None
        self.y: D = None
        self.z: J = None
        self.txt = txt

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

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

a.u = i
a.q = n
a.x = f
a.z = f
a.p = f
a.t = k
a.y = k
a.r = g
a.s = g
m.r = l
m.w = h
m.p = i
f.u = k
f.r = k
f.x = n
f.v = m
f.p = m
f.s = l
n.z = k
n.t = k
n.o = k
n.w = g
n.u = i
n.x = m
n.p = m
d.q = n
d.w = g
d.y = m
d.v = i
g.v = a
g.p = h
g.x = h
g.t = f
g.u = k
g.z = n
g.q = l
h.v = d
h.u = n
h.t = g
h.o = m
l.r = a
l.w = a
l.q = h
l.x = h
l.y = k
k.w = l
k.x = d
k.q = n
k.y = n
k.z = i
i.y = l
i.p = h
assert d.q.t.y.u.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: D = None
        self.x: C = None
        self.z: C = None
        self.p: C = None
        self.t: I = None
        self.r: F = None
        self.y: I = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: D = None
        self.v: B = None
        self.r: I = None
        self.p: B = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: F = None
        self.t: I = None
        self.o: I = None
        self.u: J = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: F = None
        self.y: B = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.t: C = None
        self.u: I = None
        self.z: D = None
        self.q: H = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: D = None
        self.t: F = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.w: A = None
        self.y: I = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: E = None
        self.q: D = None
        self.y: D = None
        self.z: J = None
        self.txt = txt

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

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

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