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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.u: E = None
        self.y: C = None
        self.s: H = None
        self.p: I = None
        self.z: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: D = None
        self.v: J = None
        self.p: D = None
        self.y: A = None
        self.r: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.q: J = None
        self.v: I = None
        self.s: B = None
        self.o: A = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: E = None
        self.u: E = None
        self.y: C = None
        self.s: H = None
        self.p: I = None
        self.z: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: D = None
        self.v: J = None
        self.p: D = None
        self.y: A = None
        self.r: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: E = None
        self.q: J = None
        self.v: I = None
        self.s: B = None
        self.o: A = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: D = None
        self.txt = txt

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

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