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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: H = None
        self.z: A = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: B = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: H = None
        self.u: B = None
        self.q: G = None
        self.o: I = None
        self.z: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.s: E = None
        self.r: J = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.y: F = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: H = None
        self.z: A = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: B = None
        self.z: F = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: H = None
        self.u: B = None
        self.q: G = None
        self.o: I = None
        self.z: J = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.s: E = None
        self.r: J = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.y: F = None
        self.p: C = None
        self.x: B = None
        self.txt = txt

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

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