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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: A = None
        self.y: I = None
        self.r: G = None
        self.w: F = None
        self.v: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: J = None
        self.v: G = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: D = None
        self.o: I = None
        self.y: J = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: G = None
        self.s: H = None
        self.v: E = None
        self.z: A = None
        self.y: E = None
        self.w: J = None
        self.u: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.o: I = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: A = None
        self.y: I = None
        self.r: G = None
        self.w: F = None
        self.v: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: J = None
        self.v: G = None
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: D = None
        self.o: I = None
        self.y: J = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: G = None
        self.s: H = None
        self.v: E = None
        self.z: A = None
        self.y: E = None
        self.w: J = None
        self.u: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.o: I = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

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

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