class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: B = None
        self.w: C = None
        self.z: D = None
        self.s: I = None
        self.o: D = None
        self.x: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.z: G = None
        self.s: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: H = None
        self.w: B = None
        self.t: F = None
        self.r: E = None
        self.q: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: A = None
        self.s: G = None
        self.v: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.z: G = None
        self.s: E = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: H = None
        self.w: B = None
        self.t: F = None
        self.r: E = None
        self.q: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: A = None
        self.s: G = None
        self.v: A = None
        self.r: H = None
        self.txt = txt

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

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