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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.o: H = None
        self.v: C = None
        self.z: C = None
        self.u: G = None
        self.x: J = None
        self.w: H = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: A = None
        self.o: D = None
        self.s: D = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: G = None
        self.q: D = None
        self.s: I = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.y: F = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: B = None
        self.o: G = None
        self.x: A = None
        self.v: G = None
        self.w: F = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.o: H = None
        self.v: C = None
        self.z: C = None
        self.u: G = None
        self.x: J = None
        self.w: H = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: A = None
        self.o: D = None
        self.s: D = None
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: G = None
        self.q: D = None
        self.s: I = None
        self.z: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: J = None
        self.y: F = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: B = None
        self.o: G = None
        self.x: A = None
        self.v: G = None
        self.w: F = None
        self.p: C = None
        self.z: D = None
        self.txt = txt

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

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

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