A token is placed in one square of a $m\times n$ board, and is moved according to the following rules:

[list]
[*]In each turn, the token can be moved to a square sharing a side with the one currently occupied.

[*]The token cannot be placed in a square that has already been occupied. 

[*]Any two consecutive moves cannot have the same direction.[/list]

The game ends when the token cannot be moved. Determine the values of $m$ and $n$ for which, by placing the token in some square, all the squares of the board will have been occupied in the end of the game.
1. **Understanding the Problem:**
   We need to determine the values of \( m \) and \( n \) for which it is possible to move a token on an \( m \times n \) board such that all squares are visited exactly once, following the given movement rules.

2. **Hamiltonian Path:**
   The problem essentially asks for a Hamiltonian path on an \( m \times n \) grid, where the path must follow the additional constraints that no two consecutive moves are in the same direction and no square is visited more than once.

3. **Case Analysis:**
   - **Case 1: \( m = 1 \) or \( n = 1 \):**
     If either \( m \) or \( n \) is 1, the board is a single row or column. The token can simply move from one end to the other, visiting all squares. This is trivially a Hamiltonian path.
     - If \( m = 1 \), \( n \) can be any positive integer.
     - If \( n = 1 \), \( m \) can be any positive integer.

   - **Case 2: \( m = 2 \) or \( n = 2 \):**
     If either \( m \) or \( n \) is 2, the board is two rows or two columns. We can start at one corner and zigzag through the board, ensuring that no two consecutive moves are in the same direction.
     - If \( m = 2 \), \( n \) can be any positive integer.
     - If \( n = 2 \), \( m \) can be any positive integer.

   - **Case 3: \( m > 2 \) and \( n > 2 \):**
     If both \( m \) and \( n \) are greater than 2, we need to check if a Hamiltonian path is possible. Consider the following:
     - A Hamiltonian path must visit all squares exactly once.
     - The path must change direction at every move.
     - If the path enters a corner, it must exit through a different side, which forces a revisit of a square due to the constraints.

     This leads to a contradiction because the path cannot continue without revisiting a square or breaking the direction change rule. Therefore, a Hamiltonian path is not possible for \( m > 2 \) and \( n > 2 \).

4. **Conclusion:**
   The only possible values for \( m \) and \( n \) that allow the token to visit all squares exactly once, following the given movement rules, are:
   - \( 1 \times 1 \)
   - \( 2 \times N \) for any \( N \geq 1 \)
   - \( N \times 2 \) for any \( N \geq 1 \)

The final answer is \( \boxed{ 1 \times 1 } \), \( 2 \times N \) for any \( N \geq 1 \), and \( N \times 2 \) for any \( N \geq 1 \).