class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: I = None
        self.t: A = None
        self.p: F = None
        self.x: A = None
        self.w: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.q: E = None
        self.o: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: I = None
        self.t: A = None
        self.p: F = None
        self.x: A = None
        self.w: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.q: E = None
        self.o: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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