class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.y: J = None
        self.o: F = None
        self.r: D = None
        self.w: F = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.s: E = None
        self.w: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: I = None
        self.w: G = None
        self.q: G = None
        self.y: I = None
        self.u: I = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.u: J = None
        self.s: B = None
        self.t: G = None
        self.o: H = None
        self.p: I = None
        self.q: C = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: A = None
        self.t: J = None
        self.w: C = None
        self.v: E = None
        self.p: D = None
        self.s: E = None
        self.y: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.s: E = None
        self.w: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: I = None
        self.w: G = None
        self.q: G = None
        self.y: I = None
        self.u: I = None
        self.x: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: B = None
        self.u: J = None
        self.s: B = None
        self.t: G = None
        self.o: H = None
        self.p: I = None
        self.q: C = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: A = None
        self.t: J = None
        self.w: C = None
        self.v: E = None
        self.p: D = None
        self.s: E = None
        self.y: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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