class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: G = None
        self.r: H = None
        self.q: J = None
        self.t: D = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: H = None
        self.t: H = None
        self.w: C = None
        self.q: C = None
        self.x: D = None
        self.p: D = None
        self.z: D = None
        self.r: G = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.s: B = None
        self.q: E = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: E = None
        self.p: G = None
        self.w: J = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: G = None
        self.r: H = None
        self.q: J = None
        self.t: D = None
        self.s: C = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: H = None
        self.t: H = None
        self.w: C = None
        self.q: C = None
        self.x: D = None
        self.p: D = None
        self.z: D = None
        self.r: G = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: B = None
        self.s: B = None
        self.q: E = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: E = None
        self.p: G = None
        self.w: J = None
        self.x: E = None
        self.txt = txt

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

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

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

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