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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.v: E = None
        self.s: E = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.s: J = None
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: J = None
        self.r: E = None
        self.v: J = None
        self.u: J = None
        self.q: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.v: E = None
        self.s: E = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: F = None
        self.s: J = None
        self.u: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: J = None
        self.r: E = None
        self.v: J = None
        self.u: J = None
        self.q: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.o: G = None
        self.txt = txt

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

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