class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: I = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: C = None
        self.o: I = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: J = None
        self.x: B = None
        self.y: B = None
        self.z: H = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: E = None
        self.u: E = None
        self.q: D = None
        self.t: I = None
        self.x: F = None
        self.p: B = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: G = None
        self.q: E = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: C = None
        self.o: I = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: J = None
        self.x: B = None
        self.y: B = None
        self.z: H = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: J = None
        self.v: E = None
        self.u: E = None
        self.q: D = None
        self.t: I = None
        self.x: F = None
        self.p: B = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: G = None
        self.q: E = None
        self.r: G = None
        self.txt = txt

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

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