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

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

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

i = A("i")
h = B("h")
g = C("g")
l = B("l")
f = C("f")
d = A("d")
k = A("k")
b = C("b")
a = C("a")
n = C("n")

i.y = f
h.u = a
h.z = a
g.y = k
g.z = l
g.s = l
l.u = n
l.z = f
f.y = k
f.z = l
f.s = l
d.y = b
k.y = a
b.y = d
b.z = l
b.s = l
a.y = k
a.z = l
a.s = h
n.y = i
n.z = l
n.s = h
assert h.u.s.z.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

i = A("i")
h = B("h")
g = C("g")
l = B("l")
f = C("f")
d = A("d")
k = A("k")
b = C("b")
a = C("a")
n = C("n")

i.y = f
h.u = a
h.z = a
g.y = k
g.z = l
g.s = l
l.u = n
l.z = f
f.y = k
f.z = l
f.s = l
d.y = b
k.y = a
b.y = d
b.z = l
b.s = l
a.y = k
a.z = l
a.s = h
n.y = i
n.z = l
n.s = h
assert h.u.s.z.z.u.txt == "n"