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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: J = None
        self.s: D = None
        self.v: H = None
        self.y: G = None
        self.z: I = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: J = None
        self.y: F = None
        self.t: E = None
        self.s: A = None
        self.p: G = None
        self.q: A = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.p: E = None
        self.o: J = None
        self.w: E = None
        self.r: E = None
        self.z: H = None
        self.q: E = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: F = None
        self.x: A = None
        self.o: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: J = None
        self.s: D = None
        self.v: H = None
        self.y: G = None
        self.z: I = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: J = None
        self.y: F = None
        self.t: E = None
        self.s: A = None
        self.p: G = None
        self.q: A = None
        self.u: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: F = None
        self.p: E = None
        self.o: J = None
        self.w: E = None
        self.r: E = None
        self.z: H = None
        self.q: E = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: F = None
        self.x: A = None
        self.o: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

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

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