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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: D = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: F = None
        self.u: G = None
        self.z: D = None
        self.y: I = None
        self.p: A = None
        self.o: H = None
        self.v: B = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.q: D = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: D = None
        self.v: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: F = None
        self.u: G = None
        self.z: D = None
        self.y: I = None
        self.p: A = None
        self.o: H = None
        self.v: B = None
        self.t: A = None
        self.w: A = None
        self.txt = txt

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

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