class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: G = None
        self.t: I = None
        self.z: J = None
        self.s: D = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: H = None
        self.o: H = None
        self.r: H = None
        self.z: H = None
        self.y: I = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.z: B = None
        self.q: F = None
        self.r: I = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: D = None
        self.r: F = None
        self.z: I = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.v: D = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: D = None
        self.p: I = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: G = None
        self.u: H = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: H = None
        self.o: H = None
        self.r: H = None
        self.z: H = None
        self.y: I = None
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: A = None
        self.z: B = None
        self.q: F = None
        self.r: I = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: D = None
        self.r: F = None
        self.z: I = None
        self.x: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.v: D = None
        self.x: D = None
        self.p: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: D = None
        self.p: I = None
        self.y: G = None
        self.txt = txt

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

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