def METHOD_NAME(p, m):
    return [
        (x, y)
        for (x, y) in [
            (p[0] + 1, p[1]),
            (p[0] - 1, p[1]),
            (p[0] + 1, p[1] - 1),
            (p[0] - 1, p[1] - 1),
            (p[0] + 1, p[1] + 1),
            (p[0] - 1, p[1] + 1),
            (p[0], p[1] - 1),
            (p[0], p[1] + 1),
        ]
        if x >= 0 and y >= 0 and x < m and y < m
    ]