Game theory

This is a 2 player game . There are matchsticks . A person can remove either 1 matchstick or any 2 adjacent matchsticks . Removing a matchstick creates a hole. I denotes a matchstick , X denotes a hole .

Example IIII

There are four matchsticks. Now if the first player removes second matchstick (IXII) then only second and third matchsticks are adjacent now . Given a number n denoting the length of string and the string in the next line , output if it possible for player 1 to win assuming he takes the first turn . The player who makes the last move wins the game . Assume both players play optimally.

Sorry if problem is not clear as i dont remember it exactly . This was asked in a coding round held in our college for internship.

Example
3
III
output : Win
4
IXXI
output : Loose

Please let me know the logic or the approach of the above problem .