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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: D = None
        self.o: E = None
        self.t: F = None
        self.q: A = None
        self.x: F = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.x: J = None
        self.z: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: D = None
        self.o: E = None
        self.t: F = None
        self.q: A = None
        self.x: F = None
        self.z: J = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.x: J = None
        self.z: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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