class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: I = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.y: D = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: I = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.y: D = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

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

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