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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: I = None
        self.w: I = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: I = None
        self.w: I = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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