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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: J = None
        self.y: G = None
        self.v: I = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.w: C = None
        self.t: B = None
        self.x: I = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: C = None
        self.t: E = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: J = None
        self.y: G = None
        self.v: I = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.w: C = None
        self.t: B = None
        self.x: I = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: C = None
        self.t: E = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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