class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: I = None
        self.p: D = None
        self.t: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: A = None
        self.y: F = None
        self.u: A = None
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: J = None
        self.w: H = None
        self.x: E = None
        self.z: A = None
        self.u: C = None
        self.t: H = None
        self.s: E = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.q: J = None
        self.x: F = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: F = None
        self.p: C = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: A = None
        self.y: F = None
        self.u: A = None
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: J = None
        self.w: H = None
        self.x: E = None
        self.z: A = None
        self.u: C = None
        self.t: H = None
        self.s: E = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: D = None
        self.q: J = None
        self.x: F = None
        self.w: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: F = None
        self.p: C = None
        self.r: H = None
        self.txt = txt

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

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

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