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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: J = None
        self.w: F = None
        self.o: J = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.z: J = None
        self.t: C = None
        self.v: F = None
        self.r: E = None
        self.s: H = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: C = None
        self.w: I = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: E = None
        self.z: H = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.q: G = None
        self.t: J = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: J = None
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: J = None
        self.w: F = None
        self.o: J = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.z: J = None
        self.t: C = None
        self.v: F = None
        self.r: E = None
        self.s: H = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: C = None
        self.w: I = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.p: E = None
        self.z: H = None
        self.s: C = None
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: C = None
        self.q: G = None
        self.t: J = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: J = None
        self.z: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: F = None
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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