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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.x: H = None
        self.q: F = None
        self.s: F = None
        self.v: I = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: H = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: A = None
        self.x: C = None
        self.o: A = None
        self.y: F = None
        self.t: F = None
        self.z: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.q: J = None
        self.p: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: G = None
        self.x: H = None
        self.q: F = None
        self.s: F = None
        self.v: I = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: H = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: A = None
        self.x: C = None
        self.o: A = None
        self.y: F = None
        self.t: F = None
        self.z: H = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.q: J = None
        self.p: C = None
        self.txt = txt

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

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

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