class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: C = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: J = None
        self.z: C = None
        self.u: G = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.r: B = None
        self.v: B = None
        self.y: I = None
        self.z: J = None
        self.o: F = None
        self.u: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.v: C = None
        self.p: B = None
        self.q: C = None
        self.u: A = None
        self.o: G = None
        self.s: I = None
        self.w: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: J = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.z: G = None
        self.o: J = None
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: I = None
        self.z: E = None
        self.q: A = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.z: H = None
        self.u: B = None
        self.s: A = None
        self.q: J = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: J = None
        self.z: C = None
        self.u: G = None
        self.w: E = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: E = None
        self.r: B = None
        self.v: B = None
        self.y: I = None
        self.z: J = None
        self.o: F = None
        self.u: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: A = None
        self.v: C = None
        self.p: B = None
        self.q: C = None
        self.u: A = None
        self.o: G = None
        self.s: I = None
        self.w: E = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: J = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: A = None
        self.z: G = None
        self.o: J = None
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: I = None
        self.z: E = None
        self.q: A = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: F = None
        self.z: H = None
        self.u: B = None
        self.s: A = None
        self.q: J = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: I = None
        self.txt = txt

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

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