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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.v: J = None
        self.u: F = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.v: G = None
        self.w: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: F = None
        self.y: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: F = None
        self.v: J = None
        self.u: F = None
        self.s: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.s: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.v: G = None
        self.w: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: F = None
        self.y: H = None
        self.txt = txt

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

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