class A:
    def __init__(self, txt: str):
        self.v: J = None
        self.p: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: H = None
        self.u: G = 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.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: J = None
        self.r: G = None
        self.o: E = None
        self.v: G = None
        self.s: G = None
        self.p: B = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: H = None
        self.txt = txt

e = A("e")
b = B("b")
c = C("c")
d = D("d")
f = E("f")
i = F("i")
l = G("l")
g = H("g")
n = I("n")
h = J("h")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: H = None
        self.u: G = 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.q: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: J = None
        self.r: G = None
        self.o: E = None
        self.v: G = None
        self.s: G = None
        self.p: B = None
        self.t: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: H = None
        self.txt = txt

e = A("e")
b = B("b")
c = C("c")
d = D("d")
f = E("f")
i = F("i")
l = G("l")
g = H("g")
n = I("n")
h = J("h")

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