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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: B = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: A = None
        self.r: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.r: D = None
        self.z: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: B = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: A = None
        self.r: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: D = None
        self.r: D = None
        self.z: D = None
        self.txt = txt

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

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