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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.o: A = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: H = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: I = None
        self.q: B = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.t: A = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.o: H = None
        self.p: C = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.o: A = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: H = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: I = None
        self.q: B = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: A = None
        self.t: A = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.o: H = None
        self.p: C = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

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

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

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