class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: E = None
        self.v: I = None
        self.w: H = None
        self.t: E = None
        self.q: F = None
        self.y: G = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: I = None
        self.u: H = None
        self.r: F = None
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: F = None
        self.s: C = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: I = None
        self.u: E = None
        self.x: C = None
        self.t: B = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: I = None
        self.y: I = None
        self.v: F = None
        self.u: J = None
        self.s: H = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: A = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: E = None
        self.v: I = None
        self.w: H = None
        self.t: E = None
        self.q: F = None
        self.y: G = None
        self.o: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: I = None
        self.u: H = None
        self.r: F = None
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: F = None
        self.s: C = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: I = None
        self.u: E = None
        self.x: C = None
        self.t: B = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: I = None
        self.y: I = None
        self.v: F = None
        self.u: J = None
        self.s: H = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: A = None
        self.q: B = None
        self.v: E = None
        self.txt = txt

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

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

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

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