Let $T$ be the triangle in the coordinate plane with vertices $(0,0), (4,0),$ and $(0,3).$ Consider the following five isometries (rigid transformations) of the plane: rotations of $90^{\circ}, 180^{\circ},$ and $270^{\circ}$ counterclockwise around the origin, reflection across the $x$-axis, and reflection across the $y$-axis. How many of the $125$ sequences of three of these transformations (not necessarily distinct) will return $T$ to its original position? (For example, a $180^{\circ}$ rotation, followed by a reflection across the $x$-axis, followed by a reflection across the $y$-axis will return $T$ to its original position, but a $90^{\circ}$ rotation, followed by a reflection across the $x$-axis, followed by another reflection across the $x$-axis will not return $T$ to its original position.)
[asy] size(10cm); Label f;  f.p=fontsize(6);  xaxis(-6,6,Ticks(f, 2.0));  yaxis(-6,6,Ticks(f, 2.0));  filldraw(origin--(4,0)--(0,3)--cycle, gray, black+linewidth(1)); [/asy] First, any combination of motions we can make must reflect $T$ an even number of times. This is because every time we reflect $T$, it changes orientation. Once $T$ has been flipped once, no combination of rotations will put it back in place because it is the mirror image; however, flipping it again changes it back to the original orientation. Since we are only allowed $3$ transformations and an even number of them must be reflections, we either reflect $T$ $0$ times or $2$ times. Case 1: $0$ reflections on $T$. In this case, we must use $3$ rotations to return $T$ to its original position. Notice that our set of rotations, $\{90^\circ,180^\circ,270^\circ\}$, contains every multiple of $90^\circ$ except for $0^\circ$. We can start with any two rotations $a,b$ in $\{90^\circ,180^\circ,270^\circ\}$ and there must be exactly one $c \equiv -a - b \pmod{360^\circ}$ such that we can use the three rotations $(a,b,c)$ which ensures that $a + b + c \equiv 0^\circ \pmod{360^\circ}$. That way, the composition of rotations $a,b,c$ yields a full rotation. For example, if $a = b = 90^\circ$, then $c \equiv -90^\circ - 90^\circ = -180^\circ \pmod{360^\circ}$, so $c = 180^\circ$ and the rotations $(90^\circ,90^\circ,180^\circ)$ yields a full rotation. The only case in which this fails is when $c$ would have to equal $0^\circ$. This happens when $(a,b)$ is already a full rotation, namely, $(a,b) = (90^\circ,270^\circ),(180^\circ,180^\circ),$ or $(270^\circ,90^\circ)$. However, we can simply subtract these three cases from the total. Selecting $(a,b)$ from $\{90^\circ,180^\circ,270^\circ\}$ yields $3 \cdot 3 = 9$ choices, and with $3$ that fail, we are left with $6$ combinations for case $1$. Case 2: $2$ reflections on $T$. In this case, we first eliminate the possibility of having two of the same reflection. Since two reflections across the x-axis maps $T$ back to itself, inserting a rotation before, between, or after these two reflections would change $T$'s final location, meaning that any combination involving two reflections across the x-axis would not map $T$ back to itself. The same applies to two reflections across the y-axis. Therefore, we must use one reflection about the x-axis, one reflection about the y-axis, and one rotation. Since a reflection about the x-axis changes the sign of the y component, a reflection about the y-axis changes the sign of the x component, and a $180^\circ$ rotation changes both signs, these three transformation composed (in any order) will suffice. It is therefore only a question of arranging the three, giving us $3! = 6$ combinations for case 2. Combining both cases we get $6+6=\fbox{12}$.