A certain machine has a display showing an integer $x$, and two keys, $\mathrm{A}$ and B. When key $\mathrm{A}$ is pressed, the number $x$ on the display is replaced by $2 x+1$. When key $\mathrm{B}$ is pressed, the number $x$ on the display is replaced by $3 x-1$. What is the largest two-digit number that can be obtained by pressing some sequence of keys $\mathrm{A}$ and $\mathrm{B}$ starting from the number 5 on the display?
(a) 85
(b) 87
(c) 92
(d) 95
(e) 96
The correct option is (d).

The diagram below shows the results of two digits that can be obtained from the number 5 by pressing each of the two keys.

![](https://cdn.mathpix.com/cropped/2024_05_01_280b19a87fa67143351eg-049.jpg?height=760&width=760&top_left_y=702&top_left_x=682)