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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: J = None
        self.q: D = None
        self.w: F = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: H = None
        self.o: D = None
        self.r: B = None
        self.p: I = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.v: E = None
        self.r: F = None
        self.x: A = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: A = None
        self.z: C = None
        self.u: I = None
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: J = None
        self.q: D = None
        self.w: F = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: H = None
        self.o: D = None
        self.r: B = None
        self.p: I = None
        self.x: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.v: E = None
        self.r: F = None
        self.x: A = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: A = None
        self.z: C = None
        self.u: I = None
        self.w: A = None
        self.v: A = None
        self.txt = txt

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

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