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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: J = None
        self.v: E = None
        self.w: B = None
        self.p: J = None
        self.o: J = None
        self.x: H = None
        self.t: G = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: G = None
        self.t: B = None
        self.v: D = None
        self.o: E = None
        self.s: C = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.w: C = None
        self.q: A = None
        self.r: A = None
        self.z: E = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.s: A = None
        self.u: I = None
        self.z: G = None
        self.w: B = None
        self.r: F = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.q: B = None
        self.t: C = None
        self.u: C = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: J = None
        self.v: E = None
        self.w: B = None
        self.p: J = None
        self.o: J = None
        self.x: H = None
        self.t: G = None
        self.y: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: G = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: G = None
        self.t: B = None
        self.v: D = None
        self.o: E = None
        self.s: C = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.w: C = None
        self.q: A = None
        self.r: A = None
        self.z: E = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.s: A = None
        self.u: I = None
        self.z: G = None
        self.w: B = None
        self.r: F = None
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.q: B = None
        self.t: C = None
        self.u: C = None
        self.v: H = None
        self.txt = txt

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

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

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