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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: J = None
        self.z: G = None
        self.x: G = None
        self.s: H = None
        self.w: G = None
        self.p: A = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: A = None
        self.z: J = None
        self.v: I = None
        self.u: A = None
        self.s: C = None
        self.y: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.u: I = None
        self.z: C = None
        self.o: B = None
        self.s: I = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: J = None
        self.u: D = None
        self.q: J = None
        self.v: E = None
        self.s: J = None
        self.o: B = None
        self.r: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: J = None
        self.z: G = None
        self.x: G = None
        self.s: H = None
        self.w: G = None
        self.p: A = None
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: A = None
        self.z: J = None
        self.v: I = None
        self.u: A = None
        self.s: C = None
        self.y: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: A = None
        self.u: I = None
        self.z: C = None
        self.o: B = None
        self.s: I = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: J = None
        self.u: D = None
        self.q: J = None
        self.v: E = None
        self.s: J = None
        self.o: B = None
        self.r: J = None
        self.txt = txt

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

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

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