class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: A = None
        self.q: B = None
        self.w: G = None
        self.x: D = None
        self.o: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: A = None
        self.x: E = None
        self.z: C = None
        self.s: E = None
        self.r: D = None
        self.w: J = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.p: H = None
        self.r: H = None
        self.w: H = None
        self.o: C = None
        self.x: B = None
        self.q: A = None
        self.u: I = None
        self.s: I = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: A = None
        self.q: B = None
        self.w: G = None
        self.x: D = None
        self.o: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: A = None
        self.x: E = None
        self.z: C = None
        self.s: E = None
        self.r: D = None
        self.w: J = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.p: H = None
        self.r: H = None
        self.w: H = None
        self.o: C = None
        self.x: B = None
        self.q: A = None
        self.u: I = None
        self.s: I = None
        self.txt = txt

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

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