In an $m\times n$ rectangular chessboard,there is a stone in the lower leftmost square. Two persons A,B move the stone alternately. In each step one can move the stone upward or rightward any number of squares. The one who moves it into the upper rightmost square wins. Find all $(m,n)$ such that the first person has a winning strategy.
1. **Define the Problem in Terms of Coordinates:**
   - Consider the stone's position on the chessboard as \((x, y)\), where \(x\) represents the number of steps upward needed to reach the top row, and \(y\) represents the number of steps rightward needed to reach the rightmost column.
   - The initial position of the stone is \((m-1, n-1)\) since it starts at the lower leftmost square \((0, 0)\).

2. **Transform the Problem:**
   - Imagine the grid rotated such that the stone starts at \((m-1, n-1)\) and players move it leftward or downward.
   - The goal is to reach the position \((0, 0)\).

3. **Analyze the Winning and Losing Positions:**
   - If the coordinates \((x, y)\) are equal, i.e., \(x = y\), the player to move must make them unequal by moving either leftward or downward.
   - If the coordinates \((x, y)\) are not equal, i.e., \(x \neq y\), the player to move can make them equal by moving to \((\min(x, y), \min(x, y))\).

4. **Determine the Winning Strategy:**
   - The position \((0, 0)\) is a losing position because the player who moves into this position wins.
   - Therefore, any position \((x, y)\) where \(x \neq y\) is a winning position because the player can move to a position where \(x = y\), forcing the opponent into a losing position.
   - Conversely, any position \((x, x)\) is a losing position because the player must move to a position where \(x \neq y\), giving the opponent a winning position.

5. **Apply the Analysis to the Initial Position:**
   - The initial position is \((m-1, n-1)\).
   - If \(m-1 \neq n-1\), then the initial position is a winning position for the first player.
   - If \(m-1 = n-1\), then the initial position is a losing position for the first player.

6. **Conclusion:**
   - The first player has a winning strategy if and only if \(m \neq n\).

The final answer is \( \boxed{ m \neq n } \).