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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: G = None
        self.v: I = None
        self.x: A = None
        self.u: D = None
        self.s: J = None
        self.y: J = None
        self.r: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.z: C = None
        self.s: G = None
        self.o: H = None
        self.r: C = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: A = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: F = None
        self.w: I = None
        self.z: H = None
        self.v: A = None
        self.t: A = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: G = None
        self.v: I = None
        self.x: A = None
        self.u: D = None
        self.s: J = None
        self.y: J = None
        self.r: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.z: C = None
        self.s: G = None
        self.o: H = None
        self.r: C = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: A = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: F = None
        self.w: I = None
        self.z: H = None
        self.v: A = None
        self.t: A = None
        self.u: B = None
        self.s: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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