AT
from math import sin, cos, pi
x, y = 4, 4
possible_ways = []
for m in range(4):
for m2 in range(2):
angle = pi / 6 + pi / 2 * m + pi / 6 * m2
s, c = round(sin(angle) * 2), round(cos(angle) * 2)
p_x, p_y = x + c, y + s
if (0 <= p_x <= 8) and (0 <= p_y <= 8):
possible_ways.append((p_x, p_y))
print(*possible_ways, sep='\n')