Depends on the point of sail, that is, the direction the ship is sailing relative to the wind.
Broad reach / running downwind - the flags point toward the bow.
Close-hauled / tacking upwind - the flags point at an angle, somewhat toward the stern.
Go by the diagram here: https://en.m.wikipedia.org/wiki/Point_of_sail
The flags will point in the direction of the wind arrow. ⬇️