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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.w: I = None
        self.q: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.y: E = None
        self.w: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: E = None
        self.u: E = None
        self.r: I = None
        self.p: I = None
        self.x: J = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.o: C = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.u: D = None
        self.s: H = None
        self.txt = txt

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

f = A("f")
k = B("k")
n = C("n")
e = D("e")
d = E("d")
g = F("g")
i = G("i")
j = H("j")
h = I("h")
m = J("m")

f.z = j
k.p = n
k.y = n
k.q = n
k.w = h
k.x = j
n.t = d
n.q = d
n.y = d
n.w = d
n.u = e
e.w = j
e.q = d
e.u = d
e.r = h
e.p = h
e.x = m
d.o = e
d.y = f
d.x = i
d.z = i
d.p = m
g.v = d
g.t = d
g.u = f
g.y = k
g.q = i
g.r = j
i.x = g
i.u = f
i.p = f
i.z = m
i.y = m
i.v = h
i.w = d
i.t = j
j.u = n
j.x = n
j.o = n
j.w = e
j.z = e
h.z = i
h.t = g
h.u = e
h.s = j
m.q = n
m.x = j
assert g.u.z.w.w.u.u.w.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.w: I = None
        self.q: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.y: E = None
        self.w: E = None
        self.u: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: E = None
        self.u: E = None
        self.r: I = None
        self.p: I = None
        self.x: J = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: C = None
        self.o: C = None
        self.w: D = None
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: F = None
        self.u: D = None
        self.s: H = None
        self.txt = txt

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

f = A("f")
k = B("k")
n = C("n")
e = D("e")
d = E("d")
g = F("g")
i = G("i")
j = H("j")
h = I("h")
m = J("m")

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