Suppose that we have an $n\times m$ chessboard and bishop on the square $(1,1)$. It starts to move diagonally with the following rules:

1. If bishop is in any corner square except $(1,1)$, it stops moving.
2. If bishop meets a boundary square which is not a corner, it changes the direction of motion by continuing in the only direction that is not in the opposite direction the path just traveled (i.e. will travel along positions $(3,1) \to (2,2) \to (1,3) \to (2,4) \to \cdots $)

Is it possible to determine where the bishop will stop and its path? I found the case $\min\{n,m\}\not\mid\max \{n,m\}$ hard.