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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.r: D = None
        self.p: H = None
        self.w: G = None
        self.x: J = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: G = None
        self.t: J = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: H = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: F = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.r: D = None
        self.p: H = None
        self.w: G = None
        self.x: J = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: G = None
        self.t: J = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: H = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: F = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

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

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