There are two groups of balls. Group $A$ has $50$ balls and Group $B$ has $40$ balls. Candy and Nini want to play a game with these balls. They will take turns to take balls from the two groups. Each person can take any number of balls from a group at a time, but they must take at least one ball each turn. The person who takes the last ball in the two groups will win the game. If Nini starts the game first, how many balls should she take to guarantee her success? Let's think step by step and output the final answer within \boxed{}.
user