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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: D = None
        self.r: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: D = None
        self.r: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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