class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: E = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: H = None
        self.s: C = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: F = None
        self.q: D = None
        self.y: I = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.q: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: F = None
        self.z: A = None
        self.o: H = None
        self.u: E = None
        self.w: H = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: H = None
        self.s: C = None
        self.w: A = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: F = None
        self.q: D = None
        self.y: I = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: G = None
        self.q: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: F = None
        self.z: A = None
        self.o: H = None
        self.u: E = None
        self.w: H = None
        self.q: A = None
        self.x: H = None
        self.txt = txt

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

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